Using
onClick for a Back Button
|
When
clicked the arrow button, adjacent to the java code below,
will load the previous URL in the History list. This means
it is equivalent to the brower's Back button! |
The
Code for the script is:
<a href="#" onClick="history.go(-1)">
<IMG SRC="Back.JPG"></a>
|
|
The
Java code is embedded in the HTML link tag.
- The onClick event is placed within the link tag
- the
onClick event handler executes the code, history.go(-1)
when the link is clicked
- history.go(-1)
loads the previous URL address in the history list
- history.go(1)
would load the the next URL in the history list
- history.go(location)
would load a specified URL from the history list
|
Using onMouseOver to change Status Bar
|
The Function is called using the onMouseOver event handler:
<a href="#" onMouseOver="window.status='On
rollover button';return true"
onMouseOut="window.status='Off rollover button';return true"
>
<img src="imagefile.gif"></a>
|
Again
the Java code is embedded in the HTML link tag.
-
The onMouseOver and onMouseOut event handlers are placed
within the link tag
- The
object status bar will display the text in the single
quotation marks
- The
semi colon is used to separate the java statements
|