Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript is causing my page to crash in IE8 but works in chrome, firefox and safari

I have a page on my website that uses a lot of javascript. When loading it in firefox, chrome, safari... it loads fine.

But when I try to view the page in Internet Explorer 8 none of the content is loaded and no error message is given.

If I delete all the javascript but leave in the javascrip tags <script type='text/javascript'> </script> the page still doesn't load.

But after removing the script tags the page loads, all be it without any javascript and is therefore useless.

The page is part of an jquery tab setup. All the other tabs contain javascript and load fine, it is just this page.

Any ideas on why this is happening would be greatly appreciated.

like image 244
user602240 Avatar asked Feb 13 '11 23:02

user602240


People also ask

Why JavaScript is not working in my browser?

On the web browser menu click on the "Edit" and select "Preferences". In the "Preferences" window select the "Security" tab. In the "Security" tab section "Web content" mark the "Enable JavaScript" checkbox. Click on the "Reload the current page" button of the web browser to refresh the page.

Is JavaScript supported by all browsers?

All the modern browsers come with built-in support for JavaScript. Frequently, you may need to enable or disable this support manually. This chapter explains the procedure of enabling and disabling JavaScript support in your browsers: Internet Explorer, Firefox, chrome, and Opera.


1 Answers

Given the lack of information, this is only a guess but it's one of the most common reasons for scripts to fail in Internet Explore.

Check for a superfluous comma on any object properties or array members, for example

var foo = {
    bar: 'bar',
    baz: 'baz',  <-- this comma
};

This is only a problem for IE. All other browsers can deal with this syntax.

like image 66
Phil Avatar answered Oct 18 '22 14:10

Phil