bPopup不是函数

bPopup is not a function?

本文关键字:函数 bPopup      更新时间:2023-09-26

我无法弄清楚真正的问题是什么,因为我已经尝试了不同版本的JQuery和Bpopup引用。

我的脚本是

<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不工作 我还包括jquery和BPopup,但它不起作用。我想我的文件没有得到Bpop参考文件。我不知道如何证实这一点

最后发现我的jquery包含了两次,这就是为什么这个错误是