Hey there, I am getting a weird error... Even though I load in all the correct libraries, and call the functions correctly, I am getting this error. Has anyone ever had this error? What would cause it? Some code for what I did. It includes all the includes
that I have. Below it is the jquery script.
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="~/Content/jqUIcss/jquery-ui-1.8.15.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="~/Content/jqGrid /ui.jqgrid.css" />
<script src="<%=ResolveClientUrl("~/Scripts/js/jquery-1.6.2.min.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/js/jquery-ui-1.8.15.custom.min.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/lib/jquery.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/lib/jquery.metadata.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jquery.validate.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jquery.jqGrid.min.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.locale-en.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.base.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.tbltogrid.js")%>" type="text/javascript"></script>
<script src="<%=ResolveClientUrl("~/Scripts/jqDnR.js")%>" type="text/javascript"> </script>
<script src="<%=ResolveClientUrl("~/Scripts/grid.common.js")%>" type="text/javascript"></script>
This is the script that I attempt to run.
<script type="text/javascript">
$(function () {
$('a.tempDlg').live("click", function(event) {loadDialog(this, event, '#edit-set');});
$('a.AddPatDlg').live("click", function(event) {loadDialog(this, event, '#addPat');});
$('a.AcoData').live("click", function(event) {loadDialog(this, event, '#addEncounter');});
}); /* end document.ready() */
function loadDialog(tag, event, target) {
event.preventDefault();
var $loading = $('<img src="../images/ajaxLoading.gif" alt="loading" class="ui-loading-icon">');
var $url = $(tag).attr('href');
var $title = $(tag).attr('title');
var $dialog = $('<div></div>');
$dialog.empty();
$dialog
.append($loading)
.load($url)
.dialog({
autoOpen: false
,title: $title
,width: 950
,modal: true
,minHeight: 200
,show: 'fade'
,hide: 'fade'
});
$dialog.dialog( "option", "buttons", {
"Cancel": function() {
$(this).dialog("close");
$(this).empty();
},
"Submit": function () {
var dlg = $(this);
$.ajax({
url: $url,
type: 'POST',
data: $("#target").serialize(),
success: function (response) {
$(target).html(response);
dlg.dialog('close');
dlg.empty();
$("#ajaxResult").hide().html('Record saved').fadeIn(300, function(){
var e = this;
setTimeout(function() { $(e).fadeOut(400); }, 2500 );
});
},
error: function (xhr) {
if (xhr.status == 400)
dlg.html(xhr.responseText, xhr.status); /* display validation errors in edit dialog */
else
displayError(xhr.responseText, xhr.status); /* display other errors in separate dialog */
}
});
}
});
$dialog.dialog('open');
};
function displayError(message, status)
{
var $dialog = $(message);
$dialog
.dialog({
modal: true,
title: status + ' Error',
buttons: {
Ok: function() {
$(this).dialog( "close" );
}
}
});
return false;
};
)};
</script>
DmainEvent
Member
86 Points
129 Posts
Microsoft JScript runtime error: Object doesn't support property or method 'dialog' from jquery U...
Aug 19, 2011 05:35 PM|LINK
Hey there, I am getting a weird error... Even though I load in all the correct libraries, and call the functions correctly, I am getting this error. Has anyone ever had this error? What would cause it? Some code for what I did. It includes all the includes that I have. Below it is the jquery script.
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" type="text/css" href="~/Content/jqUIcss/jquery-ui-1.8.15.custom.css" /> <link rel="stylesheet" type="text/css" media="screen" href="~/Content/jqGrid /ui.jqgrid.css" /> <script src="<%=ResolveClientUrl("~/Scripts/js/jquery-1.6.2.min.js")%>" type="text/javascript"></script> <script src="<%=ResolveClientUrl("~/Scripts/js/jquery-ui-1.8.15.custom.min.js")%>" type="text/javascript"></script> <script src="<%=ResolveClientUrl("~/Scripts/lib/jquery.js")%>" type="text/javascript"></script> <script src="<%=ResolveClientUrl("~/Scripts/lib/jquery.metadata.js")%>" type="text/javascript"></script> <script src="<%=ResolveClientUrl("~/Scripts/jquery.validate.js")%>" type="text/javascript"></script> <script src="<%=ResolveClientUrl("~/Scripts/jquery.jqGrid.min.js")%>" type="text/javascript"></script> <script src="<%=ResolveClientUrl("~/Scripts/grid.locale-en.js")%>" type="text/javascript"></script> <script src="<%=ResolveClientUrl("~/Scripts/grid.base.js")%>" type="text/javascript"></script> <script src="<%=ResolveClientUrl("~/Scripts/grid.tbltogrid.js")%>" type="text/javascript"></script> <script src="<%=ResolveClientUrl("~/Scripts/jqDnR.js")%>" type="text/javascript"> </script> <script src="<%=ResolveClientUrl("~/Scripts/grid.common.js")%>" type="text/javascript"></script> This is the script that I attempt to run. <script type="text/javascript"> $(function () { $('a.tempDlg').live("click", function(event) {loadDialog(this, event, '#edit-set');}); $('a.AddPatDlg').live("click", function(event) {loadDialog(this, event, '#addPat');}); $('a.AcoData').live("click", function(event) {loadDialog(this, event, '#addEncounter');}); }); /* end document.ready() */ function loadDialog(tag, event, target) { event.preventDefault(); var $loading = $('<img src="../images/ajaxLoading.gif" alt="loading" class="ui-loading-icon">'); var $url = $(tag).attr('href'); var $title = $(tag).attr('title'); var $dialog = $('<div></div>'); $dialog.empty(); $dialog .append($loading) .load($url) .dialog({ autoOpen: false ,title: $title ,width: 950 ,modal: true ,minHeight: 200 ,show: 'fade' ,hide: 'fade' }); $dialog.dialog( "option", "buttons", { "Cancel": function() { $(this).dialog("close"); $(this).empty(); }, "Submit": function () { var dlg = $(this); $.ajax({ url: $url, type: 'POST', data: $("#target").serialize(), success: function (response) { $(target).html(response); dlg.dialog('close'); dlg.empty(); $("#ajaxResult").hide().html('Record saved').fadeIn(300, function(){ var e = this; setTimeout(function() { $(e).fadeOut(400); }, 2500 ); }); }, error: function (xhr) { if (xhr.status == 400) dlg.html(xhr.responseText, xhr.status); /* display validation errors in edit dialog */ else displayError(xhr.responseText, xhr.status); /* display other errors in separate dialog */ } }); } }); $dialog.dialog('open'); }; function displayError(message, status) { var $dialog = $(message); $dialog .dialog({ modal: true, title: status + ' Error', buttons: { Ok: function() { $(this).dialog( "close" ); } } }); return false; }; )}; </script>DmainEvent
Member
86 Points
129 Posts
Re: Microsoft JScript runtime error: Object doesn't support property or method 'dialog' from jque...
Aug 19, 2011 05:41 PM|LINK
http://stackoverflow.com/questions/4832845/microsoft-jscript-runtime-error-object-doesnt-support-this-property-or-method/4832896#4832896
This actually worked for me.
Thank you for your help.