【发布时间】:2016-02-16 02:03:53
【问题描述】:
我创建了一个 AdBlock 检测器,但我的 jQuery 对话框似乎无法正常工作。注意:“adblock”变量已被引用。另外,我使用的是 Squarespace,这就是为什么我必须将代码添加到正文中。
if(adblock) {
$("body").html('<div id="alert-dialog" title="Turn off AdBlock"> Please turn your AdBlocker off. It hurts our business. To turn off AdBlock, just disable it on this page. Thank you.<br><br><br> Sincerely, The <i>Wildwood Howl</i></div>'+$("body").html());
$(function() {
$( "#alert-dialog" ).dialog();
});
}
这是错误:
TypeError: $("#alert-dialog").dialog is not a function
又名dialog 函数未定义。我不知道为什么。这是我添加的links 和scripts。
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="https://code.jquery.com/jquery-latest.min.js"></script>
点击here查看我的页面。此外,应该有背景图像,但它们没有显示出来。
我可以为此提供一个 jsfiddle。谢谢。感谢您的帮助。
【问题讨论】:
标签: javascript jquery html jquery-ui jquery-ui-dialog