Is there any reason to replace JavaScript with JScript in Internet Expolorer?
So when JScript is different from JavaScript, how does IE interpret jQuery, and all the other JavaScript-s ?
Is it better to replace t开发者_开发百科he JavaScript with JScript for IE? Are there any performance diferences?
JScript and JavaScript are the same. They're just aliases for each other:
(via Wikipedia)
As explained by JavaScript guru Douglas Crockford in his talk entitled The JavaScript Programming Language on YUI Theater, "[Microsoft] did not want to deal with Sun about the trademark issue, and so they called their implementation JScript. A lot of people think that JScript and JavaScript are different but similar languages. That's not the case. They are just different names for the same language, and the reason the names are different was to get around trademark issues."
The only scripting differences between the 2 will be in cross-browser differences.
You can insert an extra script for IE browsers only-
<script type="text/jscript" src="jsforie.js"></script>
It will boost the performance of the other browsers.
As the other people said JavaScript and JScript are one and the same. IE interprets JQuery as any other JavaScript code. If fact JQuery implements workarounds for most browser inconsistencies, including those in IE.
About the performance - IE JScript/JavaScript performance is awful compared to all other modern browsers. Awful as in more then 10 times worse.
Unfortunately, there is nothing you can do to speed it up, besides trying to persuade your visitors to use another browser.
精彩评论