bPopup is not a function?

1.9k views Asked by At

I am unable to figure out what's the real problem with this as I have tried different versions of JQuery and Bpopup references.

My Script is

<script type="text/javascript">
        $('.AddPlace').click(function (e) {
            e.preventDefault();
            $('#iframeAddNew').attr('src', 'Popups/AddCity.aspx');
            $('.PopUpAddNew').bPopup({
                content: 'iframe', //'ajax', 'iframe' or 'image'
                modalClose: false,
                contentContainer: '.content',
                speed: 50,
                position: [350, 50]
            });
        });
       
        function resizeIframe(obj) {
            if (obj.contentWindow.document.body.scrollHeight == "20") {
                obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
            }
            else {
                obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
                // alert(obj.style.height);
            }
        }
    </script>
.PopUpAddNew
     {
         margin-top: 10px;
         display: none;
         background-color: #fff;
         border-radius: 10px 10px 10px 10px;
         box-shadow: 0 0 25px 5px #999;
         color: #111;
         display: none;
         min-width: 850px;
         padding: 25px;
     }
.button.b-close, .button.bClose {
   border-radius: 7px 7px 7px 7px;
   box-shadow: none;
   font: bold 131% sans-serif;
   padding: 0 6px 2px;
   position: absolute;
   right: -7px;
   top: -7px;
}
.button {
   background-color: #2b91af;
   border-radius: 10px;
   box-shadow: 0 2px 3px rgba(0,0,0,0.3);
   color: #fff;
   cursor: pointer;
   display: inline-block;
   padding: 10px 20px;
   text-align: center;
   text-decoration: none;
}
    <script type="text/javascript" src="Scripts/jquery-1.8.3.min.js"></script>
    <script src="Scripts/bpopup.js"></script>

<div class="PopUpAddNew">
     <span class="button b-close"><span>X</span></span>
     <iframe id="iframeAddNew" scrolling="no" style="border: none" onload="resizeIframe(this);"
         width="100%"></iframe>
 </div>
<a runat="server" href="" class="AddPlace">Add Place</a>

Bpopup not working I also included jquery and BPopup but it is not working. I think my file is not getting the Bpop refrence file. I am not sure how to verify this.

1

There are 1 answers

0
WAQAS RAZZAQ On

Finally Figured it out my jquery was including two times that's why this error was