admin管理员组文章数量:1353380
I have a master page in which i included following css/js:
<script src=".11.0.min.js"></script>
<script src=".10.3/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="resources/css/jquery-ui.css">
this is my function which i used to open a popup, I am passing few parameter to load popup.
function planDataInputPopup(dialogId, formID, actionName, popHeight, popWidth, paramData) {
$(dialogId).dialog({
autoOpen : true,width : popWidth,modal : true,dialogClass: 'no-close',
draggable: true, resizable: true, position: [306,105],
buttons : {
"Create" : function() {
if(document.getElementById("dropDownCounter").value != null){
document.getElementById("dropDownCounter").value=dropDownCounter+1;
}
document.getElementById("inputPopupMode").value=true;
if(paramData == 'false'){
submitInputFormUsingAjax(formID,actionName,"#inputFormMainDiv");
}else{
submitMultipartFormUsingAjax(formID,actionName,"#inputFormMainDiv");
}
$(this).dialog("close");
$(this).remove();
//$(this).dialog("destroy");
},
Cancel : function() {
$(this).dialog("close");
$(this).remove();
//$(this).dialog("destroy");
return false;
}
},
close : function() {
$(this).dialog("close");
$(this).remove();
//$(this).dialog("destroy");
}
}); }
Above code is working fine in local, bur when i deployed on development server i'm getting exception TypeError: $(...).dialog is not a function
or sometime for "$(this).dialog("destroy")";
dialog should close but it is not happening on dev server.
what mistake i'm doing not getting.
Any help would be appreciated.
I have a master page in which i included following css/js:
<script src="http://code.jquery./jquery-1.11.0.min.js"></script>
<script src="http://code.jquery./ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="resources/css/jquery-ui.css">
this is my function which i used to open a popup, I am passing few parameter to load popup.
function planDataInputPopup(dialogId, formID, actionName, popHeight, popWidth, paramData) {
$(dialogId).dialog({
autoOpen : true,width : popWidth,modal : true,dialogClass: 'no-close',
draggable: true, resizable: true, position: [306,105],
buttons : {
"Create" : function() {
if(document.getElementById("dropDownCounter").value != null){
document.getElementById("dropDownCounter").value=dropDownCounter+1;
}
document.getElementById("inputPopupMode").value=true;
if(paramData == 'false'){
submitInputFormUsingAjax(formID,actionName,"#inputFormMainDiv");
}else{
submitMultipartFormUsingAjax(formID,actionName,"#inputFormMainDiv");
}
$(this).dialog("close");
$(this).remove();
//$(this).dialog("destroy");
},
Cancel : function() {
$(this).dialog("close");
$(this).remove();
//$(this).dialog("destroy");
return false;
}
},
close : function() {
$(this).dialog("close");
$(this).remove();
//$(this).dialog("destroy");
}
}); }
Above code is working fine in local, bur when i deployed on development server i'm getting exception TypeError: $(...).dialog is not a function
or sometime for "$(this).dialog("destroy")";
dialog should close but it is not happening on dev server.
what mistake i'm doing not getting.
Any help would be appreciated.
Share Improve this question edited Jun 11, 2014 at 5:22 amitkumar12788 asked Jun 10, 2014 at 15:21 amitkumar12788amitkumar12788 8053 gold badges10 silver badges14 bronze badges 1- Possible duplicate of JQuery UI dialog - *Dialog not a function* error – rath Commented Jan 5, 2016 at 11:27
1 Answer
Reset to default 4TypeError: $(...).dialog is not a function
is the error you get out of Firefox, when you have not loaded jqueryui
. Other browsers have equivalent errors. You can
(1) Double check that your devserver has a working and non-firewalled connection to http://code.jquery./ui/1.10.3/jquery-ui.js
, or better yet -
(2) Download a minified jquery-ui.js and include it in a third-party
or lib
directory on your server, then source it from there (this is monly seen practice).
ALSO: Calling $(this).remove()
also calls .destroy()
, which in turn calls .close()
if the dialog is still open. Both of these lines:
$(this).dialog("close");
$(this).dialog("destroy");
are pletely unnecessary, and you can safely delete them without changing any behaviour. Essentially you're making calls to .destroy()
on two consecutive lines, so the second call will result in an uninitialised error
本文标签: javascriptTypeError ()dialog is not a function on devserverStack Overflow
版权声明:本文标题:javascript - TypeError: $(...).dialog is not a function on devserver - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743930344a2563725.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论