jquery窗口未显示为已编码

时间:2017-09-11 16:26:47

标签: jquery

此代码应生成一个对话框,但只显示带有CLOSE按钮的文本。代码来自Jquery网站。

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Dialog - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script>
    $(function() {
      $("#dialog").dialog();
    });
  </script>
</head>
<body>
  <div id="dialog" title="Basic dialog">
    <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
  </div>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

您的代码似乎适用于我的浏览器(Safari 10.1.1)。 尝试从此处(或JSFiddle)和/或使用其他浏览器运行。 代码:

&#13;
&#13;
$( function() {
  $( "#dialog" ).dialog();
} );
&#13;
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

<div id="dialog" title="Basic dialog">
  <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
&#13;
&#13;
&#13;

相关问题