jQuery UI对话框-*对话框不是函数*错误 [英] JQuery UI dialog - *Dialog not a function* error

查看:111
本文介绍了jQuery UI对话框-*对话框不是函数*错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用pinax开发站点.在我的一个模板中,我试图打开一个简单的jquery对话框.但是,我不断收到对话框不是函数"的JavaScript错误.我正在使用jquery 1.2.6和jquery-ui 1.6.我的JavaScript和HTML如下:

I am developing a site using pinax. In one of my templates I am trying to open a simple jquery dialog box. However I keep getting the "Dialog not a function" javascript error. I am using jquery 1.2.6 and jquery-ui 1.6. My javascript and HTML are as follows:

<html>
<head>
<link type="text/css" href="/site_media/smoothness/ui.all.css" rel="stylesheet" />
<script src="/site_media/jquery.js" type="text/javascript"></script>
<script src="/site_media/ui/ui.core.js" type="text/javascript"></script>
<script src="/site_media/ui/ui.draggable.js" type="text/javascript"></script>
<script src="/site_media/ui/ui.resizeable.js" type="text/javascript"></script>
<script src="/site_media/ui/ui.dialog.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
                    $('#dialogbox').dialog();
            });
 </script>
 </head>
 <body>
   <div id="dialogbox" title="dialog title">
     <p>Test dialog</p>
   </div>
 </body>
 </html>

有人可以解释为什么会这样吗?

Can someone please explain why this is happening?

推荐答案

我尝试通过使用公开的google版本以及通过从jQuery UI网站下载旧版(1.6)版本并手动包含文件来重复您的错误.两者均未引起问题( http://jsbin.com/uloqi 可以正常工作).

I tried to duplicate your error both by using the public google versions and by downloading the legacy (1.6) version from the jQuery UI site and manually including the files. Neither caused a problem (http://jsbin.com/uloqi to see it working).

因此,这意味着下列其中一项可能会解决您的问题:

So, that means one of the following might solve your problem:

  1. 使用诸如Firebug for Firefox之类的工具来验证是否包含了每个JS文件.
  2. 确保页面上没有其他可能导致错误的JS.
  3. 验证您已下载了正确版本的文件.

我不知道还有什么要告诉你的,因为粘贴的代码与正确的文件配对后,效果很好.

I don't know what else to tell you since the code you pasted, when paired with the right files, works perfectly.

这篇关于jQuery UI对话框-*对话框不是函数*错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆