2016-04-29 31 views
0
<!DOCTYPE html> 
<html> 
    <head> 
     <title>jQuery Dialog Example</title> 
     <link rel="stylesheet"  href="https://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css"> 
     <script src="https://code.jquery.com/jquery-1.10.2.js"></script> 
     <script src="https://code.jquery.com/ui/1.11.0/jquery-ui.js"></script> 
    </head> 
    <script> 
     $(document).ready($(function() { 
      //Dialog box 
      $("#dialog").dialog({ 
       autoOpen: false 
      }); 
      //button to open dialog box 
      $("#button").click(function(event) { 
       $("#dialog").dialog("open"); 
      }); 
     }); 
    </script> 
    <body> 
     //div containing info about the dialog box 
     <div id="dialog"> 
     <p>This is supposed to be a calculator</p> 
    </div> 
    <input id="button" type="submit" value="Open"> 

    </body> 
</html> 
+1

只是一个友情提示,您可能需要阅读过此页: [The How-To-Ask Guide](https://stackoverflow.com/help/how-to-ask),这样你就可以确保你的问题很容易回答并且尽可能清楚。一定要包括你为解决你遇到的问题所做的任何努力,以及当你尝试修复这些问题时发生了什么。另外不要忘记你的显示代码和任何错误信息! –

+0

当我发布另一个问题时,我意识到自己的错误。感谢提示,这个错误不会再发生。 –

+0

不要难过。我们是一个很好的社区,可以帮助您学习并帮助解决您的问题。没有人会因为你犯了一个错误而生气。我们都在这里帮助您解决错误!欢迎来到社区 –

回答

0

变化$(document).ready($(function() {$(document).ready(function() { 并检查括号正确关闭

+0

谢谢,这样的菜鸟错误 –

相关问题