In my previous post, I wrote:[color=blue]
> ...
> GOAL: (very simple) Provide a hyperlink which, when clicked,
> calls a javascript function which opens a new URL.
> ...
> PROBLEM: The following code works fine if I click to open in
> the same window, but if I click the browser option to open in a
> new window, the new window tries to open the href URL (the
> onClick function does get executed, but seems to be ignored).
> ...
> <script language="javas cript">
> function NewPage() {
> location.href = "/cgi-bin/page1.pl";
> }
> </script>
> ...
> <a href="noJS.htm" onClick="NewPag e(); return false;">
> ...[/color]
I should have mentioned the following two things:
1. The above NewPage() function is just an example. The actual
function has to do some work to create the final target.
2. I originally tried just putting this into the href
href="javascrip t:NewPage();"
This worked fine for the same window, but when asking for a
new window, it tries to run NewPage() in the blank window,
which of course doesn't work.
Thanks,
Mike
> ...
> GOAL: (very simple) Provide a hyperlink which, when clicked,
> calls a javascript function which opens a new URL.
> ...
> PROBLEM: The following code works fine if I click to open in
> the same window, but if I click the browser option to open in a
> new window, the new window tries to open the href URL (the
> onClick function does get executed, but seems to be ignored).
> ...
> <script language="javas cript">
> function NewPage() {
> location.href = "/cgi-bin/page1.pl";
> }
> </script>
> ...
> <a href="noJS.htm" onClick="NewPag e(); return false;">
> ...[/color]
I should have mentioned the following two things:
1. The above NewPage() function is just an example. The actual
function has to do some work to create the final target.
2. I originally tried just putting this into the href
href="javascrip t:NewPage();"
This worked fine for the same window, but when asking for a
new window, it tries to run NewPage() in the blank window,
which of course doesn't work.
Thanks,
Mike
Comment