About this FAQ
Question:
Why this FAQ?
Answer:
The goal of this FAQ is to help you develop robust client-side scripts that canrun in Netscape Navigator as well as Microsoft Internet Explorer, under various operatingsystems. This FAQ collection is different from others in the following:
•
Here the answers are focused on platform-independent coding, rather than on one particular browser or platform.
•
Here most answers contain interactive code examples which you can run withoutleaving the Web page you are reading.
•
Here you get the solution, not just a confirmation that the problem exists. For example, other sources would just say:
Sorry, JavaScript cannot read files fromthe server
. This FAQ gives you the solution:
Here's a Java applet that helps JavaScript read files from the server.
Question:
What is JavaScript?
Answer:
JavaScript is a scripting language designed for adding interactivity to HTML pages. The language was first implemented by Netscape Communications in Netscape Navigator 2 beta (1995). JavaScript is different from the Java language (developed at SunMicrosystems). However, the two languages can interoperate well.JavaScript programs, or scripts, are usually embedded directly in HTML files. The scriptexecutes when the user's browser opens the HTML file. (There is also
server-side JavaScript
, but it's beyond the scope of this FAQ collection.)JavaScript is an
interpreted language
. This means that scripts execute without preliminary
compilation
, i.e. without conversion of the script text into a system-dependent machine code. The user's browser
interprets
the script, that is, analyzes andimmediately executes it. JavaScript is supported by the following browsers:
•
Netscape Navigator (beginning with version 2.0)
•
Microsoft Internet Explorer (beginning with version 3.0)
•
Any other browser/product whose vendor licensed or implemented JavaScriptinterpreter (for example, Opera).Thus, most Internet users today have browsers that support JavaScript. That's whyJavaScript is one of the most popular tools for adding interactive features to Web pages.
JavaScript Features