You can include external shared fragments of JavaScript into a web page by calling in a .js file.
A .js file simply contains that JavaScript which would have been placed inside a <SCRIPT> tag.
In the case of the Netscape browser, it can store configuration and preferences data in .js files.
These .js files can also be used server-side with Netscape Enterprise Server. They can be compiled with the LiveWire JavaScript compiler and linked with the HTML to create .web files that Netscape Enterprise Server can deliver very quickly to a requesting client browser.
The MIME type for a .js file used to be application/x-javascript but is now text/javascript. Either should work but text/javascript is preferred. This may necessitate you carrying out some server configuration changes if you don't already serve this kind of file.
The file is included by specifying its URL with the SRC="..." HTML tag attribute. You must also include a closing </SCRIPT> tag because <SCRIPT> is a block level item.
O'Reilly JavaScript Definitive Guide - page - 215
Wrox Instant JavaScript - page - 3
Prev | Home | Next |
JellyScript | Up | .jsc |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |