Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/402.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jQuery UI对话框未显示Squarespace adblock detect_Javascript_Jquery_Html_Jquery Ui_Jquery Ui Dialog - Fatal编程技术网

Javascript jQuery UI对话框未显示Squarespace adblock detect

Javascript jQuery UI对话框未显示Squarespace adblock detect,javascript,jquery,html,jquery-ui,jquery-ui-dialog,Javascript,Jquery,Html,Jquery Ui,Jquery Ui Dialog,我已经创建了一个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 of

我已经创建了一个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(); 
    }); 
} 
AKA未定义
对话框
函数。我不知道为什么。这里是我添加的
链接
脚本

<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>

单击以查看我的页面。此外,应该有背景图像,但它们没有显示出来


我可以为此提供一个JSFIDLE。谢谢非常感谢您的帮助。

问题可能是因为您添加了两次jQuery

<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>
---------------^ remove this

---------------^去掉这个
jQuery UI扩展了由
jQuery-1.10.2
创建的
$
,但随后添加了
jQuery latest.min.js
,这可能会覆盖先前创建的具有jQuery UI功能的
$

还要确保在计算这两个脚本并准备好DOM之后,您的代码运行正常

<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>
---------------^ remove this