Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/363.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.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 JS不适用于间接执行_Javascript_Jquery_Html_Jquery Ui - Fatal编程技术网

Javascript JS不适用于间接执行

Javascript JS不适用于间接执行,javascript,jquery,html,jquery-ui,Javascript,Jquery,Html,Jquery Ui,我有这个js代码,它可以完美地与双击一起工作,但是当我尝试将它合并到另一个文件中时,它就不起作用了。代码应该在单击按钮时显示一个弹出窗口。第二种情况下的问题是,应该在弹出窗口中显示的内容直接显示在浏览器中,当单击按钮时,什么也不会发生。有人有这方面的经验吗 <!doctype html> <html> <head> <script src="https://code.jquery.com/jquery-1.10.2.js">

我有这个js代码,它可以完美地与双击一起工作,但是当我尝试将它合并到另一个文件中时,它就不起作用了。代码应该在单击按钮时显示一个弹出窗口。第二种情况下的问题是,应该在弹出窗口中显示的内容直接显示在浏览器中,当单击按钮时,什么也不会发生。有人有这方面的经验吗

<!doctype html>
<html>
    <head>
        <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
        <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
        <link rel="stylesheet" href="https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
        <script>
            $(document).ready(function(){
                $( "#hello" ).dialog({ autoOpen: false });
                $( "#say_it" ).click(function() {
                    $( "#hello" ).dialog( "open" );
                });
            });
        </script>
    </head>
    <body>
        <p>This page wants to say "Hello!"<br>
        Be nice and press the button.</p>
        <button id="say_it">Say "Hello!"</button>
        <div id="hello" title="Hello  World!"><p><font face="Georgia" size="4">
        Hey, world, I just said "Hello!"</font></p></div>
    </body>
</html>

$(文档).ready(函数(){
$(“#你好”).dialog({autoOpen:false});
$(“#说出来”)。单击(函数(){
$(“#你好”)。对话框(“打开”);
});
});
此页面想说“你好!”
友好点,按一下按钮

说“你好!” 嘿,世界,我只是说“你好!”


是一个模拟带有样式的弹出窗口的库, 当前窗口的弹出窗口也是如此

带有Jquery ui的内部弹出窗口

$('.some').dialog( "open" );
这是外部弹出窗口

prompt("Please enter your name", "Harry Potter");
另一个

alert('other popup');
还有一个

window.open('popup.html');

你能和我们分享你的“合并”解决方案吗?我的意思是:假设这个文件是f1.html,当我试着用f2调用它时(例如,f2.html中有一个链接),它不起作用。但是当我用双击打开它时,它会工作。我看不到你的链接谢谢你,但你能建议我的代码中到底要更改什么吗?你需要一个内部或外部弹出窗口吗?我需要在单击按钮时从另一个文件调用此文件。我想准确地显示这个弹出窗口,而不是简单的提示文本。谢谢。从另一个“js”文件或其他“html”文件中?事实上它是一个.php文件。这有区别吗?