[Javascript] get link to execute script rather than load page

Cutter Bl cutterbl at hotmail.com
Wed Feb 6 07:29:18 CST 2002


onClick does not require the "javascript:...", it is implied.

Cutter
http://www.falcon-knives.com

----Original Message Follows----
From: "Andrew Gibson" <andyg at ihug.co.nz>
Reply-To: javascript at LaTech.edu
To: <javascript at LaTech.edu>
Subject: Re: [Javascript] get link to execute script rather than load page
Date: Wed, 6 Feb 2002 20:52:25 +1300

 > How do I get a link to execute some script rather than load another page?
 > (no I don't want to use a button)
 >
 > The best I can get is:
 >
 > <A HREF='#' onclick='Javascript: OpenNewWindow()'>
 >

try something like this:


<A HREF='#' onclick='Javascript:myFunction()'>

<script>
function myFunction()
{
var url=www.microsoft.com ;
window.open(url,"_blank")  ;
}
</script>

Andrew Gibson




_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com




More information about the Javascript mailing list