Fix bgiframe related JavaScript issues in IE9+

For quite a few months one of the pages in my custom project planning and tracking application would not open any pop ups in IE9 but would work fine in other browsers. The simple work around was to open that page in Chrome. Finally, when IE10 came, I decided to troubleshoot the issue.

The issue reported in the developer console was:

SCRIPT5022: InvalidCharacterError

Ultimately, with the help of the following URL it was discovered that the issue pertains to bgiframe using a regular expression which errors out in internet explorer (because of the faulty regex for IE9+).

http://stackoverflow.com/questions/6424526/bgiframe-plugin-causes-error-in-ie9

All that was done to resolve the issue was replace

$.browser.msie && /6.0/.test(navigator.userAgent)

with

$.browser.msie && /msie 6\.0/i.test(navigator.userAgent)

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