Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/467.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对话框在IE中不起作用_Javascript_Jquery - Fatal编程技术网

Javascript JQuery对话框在IE中不起作用

Javascript JQuery对话框在IE中不起作用,javascript,jquery,Javascript,Jquery,为什么这个代码在IE中不起作用?我应该怎么做才能使它正常工作? 以下代码在Firefox、Chrome和Opera中生成预期的jQueryUI模式弹出对话框。但是,它在Internet Explorer中失败 <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jq

为什么这个代码在IE中不起作用?我应该怎么做才能使它正常工作? 以下代码在Firefox、Chrome和Opera中生成预期的jQueryUI模式弹出对话框。但是,它在Internet Explorer中失败

   <!DOCTYPE html>
<html>
    <head>
     <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />  
     <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
     <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> 
    </head>

    <body>
        <script language="JavaScript">
        $(document).ready(function() {
            console.log( "ready!" );

                $("#link1").on("click", function(e) {
                    var link = this;

                    e.preventDefault();

                    $("<div>Are you sure you want to continue?</div>").dialog({
                        buttons: {
                            "Ok": function() {
                                window.location = link.href;
                            },
                            "Cancel": function() {
                                $(this).dialog("close");
                            }
                        }
                    });
                }); 
        });         
        </script>

        <a id="link1" href=http://google.com>test link</a>

    </body>
</html>

$(文档).ready(函数(){
console.log(“准备就绪!”);
$(#link1”)。在(“单击”上,函数(e){
var-link=这个;
e、 预防默认值();
$(“确实要继续吗?”)。对话框({
按钮:{
“Ok”:函数(){
window.location=link.href;
},
“取消”:函数(){
$(此).dialog(“关闭”);
}
}
});
}); 
});         
试试看
window.location.assign(link.href)

如果IE