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

Andrew Gibson andyg at ihug.co.nz
Wed Feb 6 01:52:25 CST 2002


> 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







More information about the Javascript mailing list