M
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="javascript">
function NewPage() {
location.href = "/cgi-bin/page1.pl";
}
</script>
...
<a href="noJS.htm" onClick="NewPage(); return false;">
...
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="javascript: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