[英](Only in IE) SCRIPT65535: Unexpected call to method or property access. main.js, line 152 character 28
After going through several stackoverflow posts regarding this error and none of them actually apply to my case, I am getting this error on a line in my js file in developer tools while debugging:- 在经历了几篇有关此错误的stackoverflow帖子之后,它们均未真正适用于我的情况,在调试时,我在开发人员工具的js文件的一行上收到此错误:
var el = $("#" + tagName);
el.val(el.html(value).text()); //this is the one where debugger points to
This is the relevant code in js file:- 这是js文件中的相关代码:-
$.ajax({
type: "get",
url: "cgi-bin/system_status.cgi?tokn="+sessnID+",active="+tickle_activity+",id="+page_id+",sub="+sub_id+",tab="+tab_id,
dataType: "xml",
success: function (xml) {
errorCnt = 0;
$(xml).find('response').children().each(function () {
if (this.nodeName === "user_info") {
parseUserInfo(this);
}
else {
$(this).children().each(function () {
var tagName = this.tagName;
var value = $(this).text();
/* If this is a time block then do some translation */
if (tagName === "time") {
if (showTimeValues != undefined) { showTimeValues(this); }
}
else if (tagName === "satellite") {
if (parseSatDataXml != undefined) { parseSatDataXml(xml); }
}
else if (tagName === "ntpstatus") {
if (parseNtpDataXml != undefined) { parseNtpDataXml(xml); }
}
else if (tagName === "alarms") {
if (parseAlmDataXml != undefined) { parseAlmDataXml(xml); }
}
else if (tagName === "alarmSettings") {
if (parseAlmSettingDataXml != undefined) { parseAlmSettingDataXml(xml); }
}
else if (tagName === "status") {
setStatusTextColor(value);
setStatusButton(value);
$("#" + tagName).val(value);
}
else {
var el = $("#" + tagName);
el.val(el.html(value).text());//error thrown
}
});
}
});
Only in IE im having this issue, in all other browsers it works fine and i dont observe anything else other than that error in the debugging tools. 仅在IE中出现此问题,在所有其他浏览器中它都能正常工作,除调试工具中的该错误外,我没有观察到其他任何东西。 I am using IE9 and latest jquery version 1.12.1
我正在使用IE9和最新的jquery版本1.12.1
Actually, even though I was using IE9 in my developer tools there was an option which said Browser Mode: and it was set to IE7 standards. 实际上,即使我在开发人员工具中使用IE9,也有一个选项表示浏览器模式:并且它被设置为IE7标准。 That is why I was getting this error.
这就是为什么我得到此错误。 The moment i switched to IE9 standards (not the compatibility mdoe option).
当我切换到IE9标准(不是兼容性mdoe选项)的那一刻。 It all works as expected.
一切都按预期工作。 If you are new to web development like me you might encounter this issue(not being aware that there are browser modes) as well.
如果您像我这样的网站开发新手,也可能会遇到此问题(不知道有浏览器模式)。 So in summary,
In debugger tools (F12) -> Click on browser mode and choose IE9
. 因此,总而言之,
In debugger tools (F12) -> Click on browser mode and choose IE9
。
Dont choose the compatibility option. 不要选择兼容性选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.