Re: Redirection with Javascript

by Thomas James Allen <tjallen(at)pipeline.com>

 Date:  Thu, 12 Aug 1999 21:34:09 -0400
 To:  "Rajnish Bhaskar" <9705228b(at)student.gla.ac.uk>
 Cc:  hwg-basics(at)hwg.org
  todo: View Thread, Original
At 06:04 PM 8/12/99 +0100, you wrote:
>
>After fiddling with this code for a bit, it seems that NN3 doesn't recognise 
>the "OnClick" command in Javascript.  What I have is a splash screen 
>with an image, which, when clicked on, will take you to the homepage.  I 
>wanted to use the OnClick command to call the sniffer code, but this 
>doesn't work.  I've got around it by calling the sniffer with OnMouseOver, 
>but is there any other way around this?
>------------------------------------------------------------------
Raj,
See if this will work for you in NN3.

In the head section of the document, put this script:

<script language="javascript">
<!-- hide
function replaser() {
location.replace('newurl.html');
}
//stop hiding -->
</script>

And then in the body of the document, call the script like this:

<a href="javascript:replaser()">Click image here</a>

This worked in my brief test on NN3.
The a href="javascript:functionname()" is a good trick to remember.

Hope this helps,
jimmy

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA