Soroush Hakami
Soroush Hakami

Reputation: 5396

JavaScript crash on IE8 and IE9-CompabilityMode: SCRIPT601: Unknown runtime error

Page works fine on Chrome, IE9, FF, but gives me this error on IE8 and IE9-compabilitymode: SCRIPT601: Unknown runtime error with a reference to this bit of javascript:

function Sys$WebForms$PageRequestManager$_updatePanel(updatePanelElement, rendering) {
        for (var updatePanelID in this._scriptDisposes) {
            if (this._elementContains(updatePanelElement, document.getElementById(updatePanelID))) {
                var disposeScripts = this._scriptDisposes[updatePanelID];
                for (var i = 0, l = disposeScripts.length; i < l; i++) {
                    eval(disposeScripts[i]);
                }
                delete this._scriptDisposes[updatePanelID];
            }
        }
        this._destroyTree(updatePanelElement);
        updatePanelElement.innerHTML = rendering; //this is where it crashes
    }

Any ideas on how to solve this?

Upvotes: 1

Views: 6038

Answers (2)

Ravi Shankar Kota
Ravi Shankar Kota

Reputation: 705

We can resolve this issue by using any one of the 2 solutions as below:

First Solution:

DOCTYPE might be missed in the html which need to be placed as below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

If this solution did not worked , we can try second solution.

Second Solution:

I replaced

document.getElementById('divHTML').innerHTML = HTMLData;

with

jQuery('#divHTML').html(HTMLData);

Here HTMLData is the variable that holds the html data we want to place in divHTML.

Upvotes: 0

Soroush Hakami
Soroush Hakami

Reputation: 5396

The error occured because of a misplaced

paragraph. I found this link that describes the problem.

Upvotes: 3

Related Questions