I haven’t heard this much around here, but IE8 changes its scripting behaviour depending on the document mode that the browser currently happens to be in.
For me, this helps to highlight that browser checking is not a solution for stable code, and that object detection should be used to perform capabilities checking instead.
They really should scrap this idea of “JScript” and just use plain old JavaScript. It just confuses people. Mozilla and Opera have proprietary extensions to the language and they don’t change the name, so I don’t see why it should be a problem.
All this means really is that you can’t safely use the stuff only IE8 properly allows, unless you’re willing to constantly check the document mode, or have your own function to deal with the different possibilities.
And yes, I fully agree - object detection is the way forward.
They really should scrap this idea of “JScript” and just use plain old JavaScript. It just confuses people. Mozilla and Opera have proprietary extensions to the language and they don’t change the name, so I don’t see why it should be a problem.
I saw a video in which Crockford said that “Jscript” is a name for javascript created solely to prevent Sun from making claims on javascript at Microsoft like they did against Netscape. He said the name is the sole difference between the two… however I’m sure he meant “language-wise” alone.