Intranet Journal   Earthweb  
Events Jobs Premium Services Media Kit Network Map E-mail Offers Vendor Solutions Webcasts

   Intranet Journal Subjects
Search Earthweb

Privacy Policy



internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

internet commerce
Be a Commerce Partner
















 

[ Home | Discussion Forum | How Do I... | Lotus Notes Intranets | Microsoft SharePoint | Products | Shopping  ]

free news!


Intranet Journal Intranet FAQ

IDM Intranet FAQ          [Previous | Index | Next]

Web Browsers

Answers to Questions about...
Web Browsers

14. I've heard that there are several incompatible versions of JavaScript out there: v1.0, v1.1, JScript, etc. Which "standard" should I code to?

As long as rugged individualism conflicts with community spirit, there won't be a satisfactory answer to this question -- or any other concerning multiple, competing "standards." That's an interesting bit of philosophy, you say, but it doesn't help much? Here are some facts to help you make a decision.

JavaScript is a Netscape trademark and, despite the open availability of the API, is proprietary to that company's browsers. JScript is Microsoft's implementation of JavaScript for the Internet Explorer line. JScript 1.0 (implemented in IE 3.x) and JavaScript 1.0 are roughly equivalent (with exceptions documented in books like Mark Stone's How to Program Microsoft JScript; cf. C8).

Starting with v3.x of Navigator, Netscape enhanced JavaScript with features not available in any other browser. Nice features ... if you don't mind a little lock-in. The following excerpts from newsgroup comp.lang.javascript make the same points with more, er, esprit de corps:

Posted 26 November, 1996

"For as long as IE exists, you can't write a piece of code worth writing and make it browser-independent. Unless MS actually gets an IQ or two and gets JavaScript right".rant()

JScript doesn't support the image array. Which means that your script is NS3.0 only. which is a Major bummer, esp with [dynamic graphics] in your application. So, only thing you can do is test to make sure

navigator.appName = "Netscape" and navigator.appVerson.substring(0,1) = 3

before you run your stuff. G'Luck.

Later that day...

For as long as Netscape does not implement an "open" JavaScript you can't write a piece of code browser independent. I have to say that writing JavaScript 1.0 in IE 3.0 is a joy compared to writing JavaScript 1.0 in Netscape 2.x. If you use Netscape 3.0 and JavaScript 1.1, your code will run nowhere else.

[Related topics: ECMAScript, Browser Incompatibilites]

[Recommended reference: Javascript : The Definitive Guide, 3rd ed. (O'Reilly & Associates, June 1998) by David Flanagan. Details all variants through JavaScript 1.3 and JScript 3.0.]

IDM Intranet FAQ          [Previous | Index | Next]

[print version of this page]