Javascript Works in IE8 Using IE9 Compatibility Mode but Not with IE8 Installation
This is an extremely bizarre issue that I haven't come across before. I am running a number of scripts on a pretty intensive site and everything works perfectly across IE9, FF and Chrome. Even when viewing the site in IE8 compatibility mode with IE9 the site is great.
Unfortunately when people are using a standard installation of IE8, the site is hanging on one page and eventually the "A script on this page is causing Internet Explorer to run slowly" message of death appears. The url for the page is http://horseandponysales.com.au/search-page
I have run the code through numerous applications trying to find some errors but am coming up trumps. Does anyone have any ideas what could be causing this or if you have 开发者_如何学Gorun into a similar problem before? Any help would be greatly appreciated.
The number one cause of this issue in my experience is that IE8 chokes on trailing commas in Javascript arrays or object literals:
var array [
'one',
'two',
'three', //<-- BAD COMMA
var object {
first: 'Joe',
middle: 'Clever',
last: 'Smash', // <-- BAD COMMA
}
My recommendation is to check all your JS for any of those.
精彩评论