See section 4D of the book. The <noscript> tag is treated
in section 2F.
JavaScript includes are not supported by Netscape 2 and Explorer 3.
You need to properly place a JavaScript in an HTML page to make sure the browser executes it. It isn't particularly difficult, but you do have to separate behavior (JavaScript) and structure (XHTML).
Although there are two ways of doing this, using JavaScript includes is the best way because that makes sure your JavaScript code will reside outside your HTML file. This makes your pages easier to maintain, since they contain only XHTML. It also allows you to modify the behaviour of your entire site by editing one single file.
You can also put a JavaScript directly in your page, but this method is deprecated. We'll also take a short look at the <noscript> tag.
JavaScript includes are not supported by Netscape 2 and Explorer 3.
Included JavaScript files may not be refreshed in some browsers, no matter how often you hit Reload. Solution: enter the URL of the .js file in the location bar, load it, hit Reload, go back to the HTML page and reload it.
You should include a JavaScript file in your pages. This has several advantages:
I include a JavaScript file on every page on this site as follows:
<script src="../quirksmode.js"></script>
Now whenever the page is loaded, the browser also puts the script in the file quirksmode.js in the page. Note that you do not see the script in your source code, you just see the include tag. Nonetheless the functions and variables in the included file are available to scripts on each page.
I use this include for scripts that I want available on each page, like the last modified script. To view the include, download http://www.quirksmode.org/quirksmode.js.
On this page I include a special script that contains the function testIt().
Try executing it to test your browser's support of includes.