Freigeben über


Difference in Java Script behavior across browsers

Many a times, Java Script developers are perplexed by the fact that the same piece of Java Script code written by them behaves differently on the different web browsers. The reason for the same is the different implementations of the ECMA Script language which comes with various browsers. Here is a draft of JScript Deviations from ES3 which captures some of this.

So, now if you have a Java Script or JScript code which behaves differently on different browsers, take a look at this document. It might have the snwer to your problem.

Read more about this at Pratap’s blog ECMAScript3 and beyond.

Comments

  • Anonymous
    November 05, 2007
    In reading the documentation I see things like: "IE incorrectly..." If it is IE or an other browser would is it not the responsibility of the author of browser to patch and fix the product to "correctly..." do what it needs to do instead of all of these word around to the differences? See now I envision programmers spending 80% of there time debugging difference instead of writing code relating to the Business Solution. How is AJAX or SilverLight or any other technology work with so many differences and claiming to be cross platform do they handle these differences? How much time was spent on handling differences instead of the man point of the project? As a fix to the differences is there a library that would do these fixes for us? If the patterns are identifiable could there be a layer that we write to instead of figuring out differences, like a hybrid, is AJAX pure JScript or a hybrid? When I do things the AJAX/JScript ways then I don’t have these differences instead of just doing JScript then I would need it. I'm just glad I have stayed away from JScript with the pie in the sky idea of write once and it works on many browsers NOT! The caveat of writing this article is that you have now exposed the weakness of Jscript and it is now being spelt out, before it was vague and hard to see the DIFFERENCES. We would not want someone to believe there are differences because then the write once run everywhere does not work.

  • Anonymous
    November 05, 2007
    Thank you for the resource. One thing however, it is JavaScript, not Jave Script.