【问题标题】:IE9 Javascript Error SCRIPT575 - c00c023f - Prototype fileIE9 Javascript 错误 SCRIPT575 - c00c023f - 原型文件
【发布时间】:2011-12-15 18:20:42
【问题描述】:

我遇到了同样的问题,但是在IE9的F12的控制台中,它说:

SCRIPT575: Could not complete the operation due to error c00c023f. 
prototype.js?v=7.6, line 1361 character 7

如果我单击第二行,它会将我带到该文件的脚本选项卡:

Ajax.Response = Class.create({
  initialize: function(request){
    this.request = request;
    var transport  = this.transport  = request.transport,
        readyState = this.readyState = transport.readyState;

    if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
      this.status       = this.getStatus();
      this.statusText   = this.getStatusText();
      this.responseText = String.interpret(transport.responseText);
      this.headerJSON   = this._getHeaderJSON();
    }

    if(readyState == 4) {
      var xml = transport.responseXML;
      this.responseXML  = Object.isUndefined(xml) ? null : xml;
      this.responseJSON = this._getResponseJSON();
    }
  },

指向第 10 行:

this.responseText = String.interpret(transport.responseText);

我该如何解决这个问题?

【问题讨论】:

标签: javascript internet-explorer-9 prototypejs


【解决方案1】:

删除编码:

charset=ISO-8859-1

编码可以解决这个问题。

【讨论】:

  • 切换到 UTF-8(从 ISO-8859-1)对我没有帮助 - 我仍然在 IE 上收到此错误。
【解决方案2】:

正如 James 所指出的,此错误可能是由于此处讨论的原因造成的:https://stackoverflow.com/a/7288000/360782。在这种情况下,提供的解决方案没有吸引力,因为它需要编辑 Prototype 库。我没有这样做,而是通过覆盖 respondToReadyState 更改方法来解决这个问题,这样我就可以捕获错误。这是猴子补丁(针对原型 1.7)。在加载 Prototype 之后但在使用之前,将以下内容放入您的代码中:

Ajax.Request.prototype.respondToReadyState_orig =
  Ajax.Request.prototype.respondToReadyState;
Ajax.Request.prototype.respondToReadyState = function(readyState) {
  // Catch the exception, if there is one.
  try {
    this.respondToReadyState_orig(readyState);
  }
  catch(e) {
    this.dispatchException(e);
  }
};

【讨论】:

    猜你喜欢
    • 2011-11-09
    • 1970-01-01
    • 2011-07-15
    • 2012-08-16
    • 1970-01-01
    • 1970-01-01
    • 2011-05-14
    • 1970-01-01
    • 2011-10-09
    相关资源
    最近更新 更多