JavaScript URLs
A trivial example of a JavaScript URL isjavascript:alert("Hello World!")
A JavaScript URL may appear anywhere an ordinary URL is expected:<A HREF="javascript:history.back()">Previous Page</A>
Note must use <A HREF=” javascript: void(anyoldfunction())” > if you do not want link to be invoked!
- Use HREF=“javascript: void(0)” if no action at all -- used if real action from onclick or other event handle for link
Navigator even has a mini-scripting environment invoked by typing javascript:into the browser’s location text field
- This is now (NN4.5) used to display error messages as a console instead of alternative (and clumsy) stream of windows (one per error ….)