jquery - 使用 jquery 对话框时出错?

标签 jquery jquery-ui

每次我尝试使用 jquery 对话框时,使用 firebug 进行调试时都会收到错误 null,这是代码

<script type="text/javascript" src="js/jquery-1.4.2.js"></script>

    <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css">
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
      <script>
      $(document).ready(function() {
        $("#dialog").dialog();
      });
      </script>

    <div id="dialog" title="Dialog Title">I'm in a dialog</div>

最佳答案

可能是您的 jQuery.js 文件不存在于该路径中。将其替换为 Google 托管的。

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

您还应该添加<script type="text/javascript"></script>你的 jQuery 代码在哪里。

<script type="text/javascript" src="js/jquery-1.4.2.js"></script>

<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
  <script type="text/javascript">
  $(document).ready(function() {
    $("#dialog").dialog();
  });
  </script>

<div id="dialog" title="Dialog Title">I'm in a dialog</div>

关于jquery - 使用 jquery 对话框时出错?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3432785/

相关文章:

html - jQuery <select> 改变另一个<select>

jquery - 在 jQuery ui 对话框窗口中加载 MVC4 PartialView

javascript - JQuery UI 在 Chrome 上工作,但在 Firefox 上不工作

ajax - jQuery .always() 似乎在 $.get() 请求实际完成之前触发

jquery - 使用 jQuery 更新项目拖放时的 DOM

jquery UI sortable - 允许拖动嵌入在可排序 div 中的图像以导致 div 排序的开始

javascript - jquery ui ajax 选项卡 - 重新加载选项卡或更改选项卡位置?

jquery - jQuery 的输入字段过滤解决方案

javascript - 如何在php变量中获取span文本?

jQuery - 动态 div 高度