146Part IIIDocument Objects Referenceyou design a script (Ftp web hosting) to
146Part IIIDocument Objects Referenceyou design a script to perform some action upon a mousedownevent in a paragraph whose IDis myParagraph, the script statements are enclosed in the following tag set: Statements inside the tag set execute only upon the firing of the event. No function definitionsare required. This way of binding an object s event to a script means that there is no event handler definedin the element s tag. Therefore, it guarantees that only IE4 or later can carry out the scriptwhen the event occurs. But the tag and attributes contain a lot of source code overhead foreach object s script, so this is not a technique that you should use for script statements thatneed to be called by multiple objects. Also be aware that you cannot use this tag variation if non-IE or pre-IE4 browsers load thepage. In such browsers, script statements execute as the page loads, which certainly causesscript errors. Hiding script statements from older browsersThe number of people using old Web browsers that don t support scripting languages hasdiminished considerably in the past few years. However, new devices, such as mobile phonesand pocket-sized computers, often employ compact browsers that don t have built-inJavaScript interpreters. Nonscriptable browsers do not know about the tag. Therefore, their natural inclination is to render anylines they encounter after the opening JavaScript interpreters know to ignore a line that begins with the HTML beginning commentsequence, but they need a little help with the ending sequence. The close of the HTML com- ment starts with a JavaScript comment sequence (//). This tells JavaScript to ignore the line; but a nonscriptable browser sees the ending HTML symbols and begins rendering the pagewith the next HTML tag or other text in the document. An older browser doesn t know whatthe tag is, so the tag is ignored and rendering begins after that. If you design your pages for public access, it s still a good idea to include these HTML com- ment lines in all your