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

Lau lau at goldenweb.com.au
Wed Feb 6 03:03:33 CST 2002


That's what I'm already doing and the HREF='#'  part forces the original
page to scroll to the top of the page... this is what I'm trying to avoid...
if they are at the bottom of the page I want them to stay there after
they've closed the newly opened window.


thanks
Lau




----- Original Message -----
From: "Andrew Gibson" <andyg at ihug.co.nz>
To: <javascript at LaTech.edu>
Sent: Wednesday, February 06, 2002 6:52 PM
Subject: Re: [Javascript] get link to execute script rather than load page


> > 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
>




More information about the Javascript mailing list