Javascript hell
In 1997-200x days, when I have been programming in VB3-6 , there was a problem named ”DLL Hell”.
I have been hoping that, with the introduction of .NET, we will escaping this – and I have had my request answered( ok, from .NET 2 )
However, a new problem is for WebDevelopers : JavaScript Hell. Why I am telling that ? Simple :
- I have an application that works well in IE 8 – and uses Json.Stringify to post data. Normally, when I was trying with IE7, it does not work – because JSON.Stringify was not allowed …Of course , solution was adding javascript from http://www.json.org/js.html .
- Same application use jquery 1.4 + http://knockoutjs.com/ 1.1.2 (to can modify dynamically some textboxes) + other js( a date time formatter,jquery ui and others)- . Now , in IE9 RC , jquery1.4 does not function – and you have to use jquery1.5.1.rc also.Please tell me how to know what modifications the other js files must have( in particular knockout) .
And the mock idea is not solving the issue. You must test either manually , either with an automated test for browser(like Selenium) and testing explicitely in browser version! And I have speak only about IE, not Firefox and /or Chrome…
If you are a developer, how many javascript do you use? If more than 2 ,welcome to javascript hell!
: Please read the requirements from http://msdn.microsoft.com/en-us/library/cc836459%28v=vs.85%29.aspx :
Note:
Starting with JScript 5.8, by default, the JScript scripting engine supports the language feature set as it existed in version 5.7. This is to maintain compatibility with the earlier versions of the engine. To use the complete language feature set of version 5.8, the Windows Script interface host has to invoke IActiveScriptProperty::SetProperty.
Internet Explorer 8 opts into the JScript 5.8 language features when the document mode for Internet Explorer 8 is “Internet Explorer 8 Standards” mode. For other document modes, Internet Explorer uses the version 5.7 feature set.
JScript 5.8 includes native JavaScript Object Notation (JSON) support and the accessor methods for Document Object Model (DOM) prototypes.
I would say rather “IE hell” – the problem is that in IE they added only in IE8 native JSON support (from ECMAScript 5); anyway, also the Firefox team has added native support only in 3.5 version – since both have appeared quite recently, the only viable solution is to use some kind of wrapper library..
About the 2’nd problem, also I would bet that it’s a problem IE 9 RC, not in JQuery itself.. (sure, the JQuery team has quickly implemented a workaround, but..)
Anyway, I know the feeling: currently I use in a single application JQuery, MS AJAX library and some DevExpress client-side scripts..
You should specify if you are talking about JScript or Javascript, which in IE has a different meaning.
Well that’s what JS framework are there for (including this) : abstract away the browser’s implementation of the JS engine.
Normally it should help you ignore the browser and just work. Sometimes it must be upgraded (1.4 -> 1.5) but that shouldn’t break existing (JS) code..