views:

178

answers:

4

Why some javascript error only comes in IE not in firefox? should i solve all IE javascript errors, if my site is working fine with it ?

+1  A: 

they have slightly different implementations of javascript, dom, css, etc.... should you fix the errors? if no major functionality is impacted, then it would probably be a very low priority... and depending on your userbase (say its a corporate intranet) you could simply say Firefox is your preferred browser. all depends on the requirements. Prioritizing tasks will help ensure the most important objectives are met.

jspcal
+2  A: 

should i solve all IE javascript errors, if my site is working fine with it ?

I'd say, yes absolutely. Under certain circumstances, IE throws Javascript errors right into the user's face with a big fat dialog. I think it's very embarrassing for a visitor (who may not even know what JS is, and even less the intricacies of cross-browser scripting) to get a error message as their first impression of you.

Pekka
+1 totally agree
Doug Neiner
+2  A: 

You should definitely seek to fix any JS errors you are getting in IE. What shows up in your IE as a little yellow icon, will show up in other IE browsers as a popup letting the user know there was an error.

One way you can minimize problems is by using one of the many JavaScript framework/libraries like jQuery, MooTools, etc that seek to minimize browser differences. Then, when you get specific errors, they can often be fixed by added a missing ; or adding an if statement in the correct place.

You should never knowingly leave code unfixed that is known to break in modern browsers.

Doug Neiner
+1 good thing mentioning frameworks.
Pekka
+1 about frameworks i got ur point it's better to use framework then raw javascript to get error free site
metal-gear-solid
@Jitendra it will definitely help, but browsers still have there differences. For instance, one piece of code may work fine in IE, but in Firefox it fails because of a missing `;`. The important thing is to start from a good base (jQuery) and add your code to it. It will help a lot.
Doug Neiner
now the problem is all 3 answers has good info for me i'm in dilemma which should be choosen as a answer of my question :)
metal-gear-solid
Well mine of course... haha, just kidding. But definitely pick one... the higher your accept rate, the better the answers get... at least in theory :)
Doug Neiner
Throw a coin. :)
Pekka
@Pekka, too bad we both upvoted each other... we are making this difficult on each other :)
Doug Neiner
OK. although Pekka answered my question very well but "Doug Neiner" suggested a good point to use framework to avoid errors in future so i'm going to accept his answer.
metal-gear-solid
@Doug: That's true :) Too bad you can't co-author on SO, fusing two good answers together and sharing the credit. Maybe worth a feature request?
Pekka
@Pekka, I totally agree. That would be an awesome feature!
Doug Neiner
A: 

Yes, you should fix the Javascript errors being reported in IE, because it can be unclear how the errors manifest themselves in your application. For instance, it can cause menu navigation to not work, or incorrect behavior of buttons.

As for actually detecting where the problem came from and how to fix it, you can try our Browsera service, which will detect and log the Javascript errors for you that occur in the browser, and use the Script Editor, which comes with MS Office

Or, if you dont have OFfice, use the free Microsoft Script Debugger, which works, but is less powerful.

Browsera