【发布时间】:2013-10-23 13:04:29
【问题描述】:
我使用 jquery-1.7.2.min.js
我有以下 javascript:
$(function() {
$("#del_category").click(function() {
if (confirm('Are you sure you want to delete this category?')) {
$.ajax({
type: "POST",
url: "someurl",
datatype: "json",
csd: window.parent.CSD,
success: function(data) {
if (data.isSuccess) {
if (data.isFree) {
// error appears if this function invokes
this.csd.Popup.currentWindow.hideDialog();
} else {
alert("Category uses in some FAQ.");
}
} else {
alert("Error. Category was not deleted.");
}
}
});
}
return false;
});
});
它在除 IE9 之外的所有浏览器中都能正常工作。在 IE9 中它可以正常工作(调用所有函数)但显示 js 错误:SCRIPT5009: 'String' is undefined
我该如何解决这个问题?
编辑:
此脚本可以正常运行:
$(function() {
$("#del_category").click(function() {
window.parent.CSD.Popup.currentWindow.hideDialog();
});
});
错误仅出现在 ajax OnSuccess 事件处理程序中。
【问题讨论】:
-
您显示的代码中没有对
String的引用。你能告诉我们导致错误的具体代码行吗? -
小提琴还是现场直播??
-
出现在 jquery-1.7.2.js 的 509 行: type: function( obj ) { return obj == null ?字符串( obj ) : class2type[oString.call(obj)] || “目的”; },
-
因为这是正确执行但您只在 IE 中收到错误,这可能是由拼写错误引起的吗?我相信
datatype应该是dataType?
标签: jquery ajax internet-explorer-9 undefined