JQuery – Script1024 Error & IE’s Compatibility Mode

We were testing a feature in Firefox, Chrome and IE 11 and ran into an issue wherein, JQuery would not load in IE11. Client side callbacks were not being processed. Using IE’s Developer Tools / Console window showed the error below.

screen_shot_2016-10-18_at_8_18_02_pm

Had us stumped for a few minutes and setting the Compatibility mode for Intranet Sites got the page working again.  I disabled Compatibility mode, but the page continued to work and was not able to reproduce the error. Within the Corporate Intranet, “Display intranet sites in compatibility view” setting had been enabled by default. I had disabled this setting while working on something else. Adding the Meta Tag & the proper HTML5 document tag resolved the issue. This allows for the Compatibility mode to be disabled if needed.

Another odd behavior I noticed is that  as soon as the page is loaded in Compatibility mode, it works without the DocType and Meta tag being present on the page. Removing or adding the Tags to the page and refreshing does not change behavior, it continues to work. Very difficult while trying to reproduce an issue. Developer Toolbar hung in the middle of the Debug session and had to kill IE and launch it again. That’s when I realized that a new session is required after disabling compatibility mode to re-trigger those exceptions and finally confirm the JQuery piece worked. Phew!!!

It was poor code to begin with, but the Browsers were forgiving enough to add to the frustration.

<!DOCTYPE html><meta http-equiv="X-UA-Compatible" content="IE=Edge">
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: