此代码有什么问题?对话框不是功能 [英] What's wrong with this code? dialog is not a function
问题描述
我正在尝试解决autotab遇到的另一个问题.对于这个网站,它只是无法正常工作,当一切都被正确调用时,我一直无法获得autotab的定义.
I'm trying to solve another issue I'm having with autotab. For this site it's just not working, I keep getting autotab is undefined, when everything's being called correctly.
我还注意到在控制台中,我收到"TypeError:$(...).dialog不是函数"
I also notice in the console I'm receiving "TypeError: $(...).dialog is not a function"
它所引用的块是这样的:
The block it's referencing is this:
$('#dialog-modal').dialog( {
position: ['center'],
autoOpen: false,
modal: true,
buttons: [{
text : "Close",
"class" : 'closeButtonClass',
click : function(e) {
document.getElementById("modalPopup").src = "about:blank";
$('#dialog-modal').dialog("close");
}
}]
});
有人可以告诉我什么地方可能出问题吗?这是指错误出现在具有"click:function(e){"的行上,但是那是不对的,因为那里没有对.dialog的调用.
Can anyone please tell me what could be wrong? It's saying the error is on the line that has "click : function(e) {" but that can't be right, as there's no call to .dialog there.
推荐答案
dialog()
不在标准jQuery库中;它是jQueryUI的一部分,看起来您还没有添加到页面中.包含jquery.js
之后,将以下代码添加到页面的head
中:
dialog()
is not a method within the standard jQuery library; it is part of jQueryUI, which it looks like you have not added to your page. Add the following code to the head
of your page, after you include jquery.js
:
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
这篇关于此代码有什么问题?对话框不是功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!