A
anag
I am opening pop up windows from a hint button on several pages in my
site. If the user leaves the pop up window open from a previous page, I
would like the new hint to open in that window.
I thought that by giving the pop-ups the same name it should work (see
code below) but it isnt. Every time a user clicks on the hint button
the popup opens in a new window regardless of the fact that a previous
hint window is open .
here is my code that calls the function from an html page (there is
also some rollover code in it):
<a href="javascriptpen_pop_hint('ex3_n2_hint.html', 'hint');"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('Image43','','../images/button_hint_on.gif',1)">
And here is the function that is called from an external javascript
file.
//open hint popup
function open_pop_hint(path, targ)
{
litwin = window.open(path,
targ,'width=520,height=200,toolbar=no,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
if
(parseFloat(navigator.appVersion.substring(0,navigator.appVersion.indexOf("
")))>=3.0)
{
litwin.focus();
}
}
Any help would be greatly appreciated I keep staring at the code and I
dont see where the problem is and I cant find anything on the web about
it. Everything seems to be about how this should work.
PS. the most baffling thing of all is that I used this same code on an
old site and it worked as expected.
thanks in advance
site. If the user leaves the pop up window open from a previous page, I
would like the new hint to open in that window.
I thought that by giving the pop-ups the same name it should work (see
code below) but it isnt. Every time a user clicks on the hint button
the popup opens in a new window regardless of the fact that a previous
hint window is open .
here is my code that calls the function from an html page (there is
also some rollover code in it):
<a href="javascriptpen_pop_hint('ex3_n2_hint.html', 'hint');"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('Image43','','../images/button_hint_on.gif',1)">
And here is the function that is called from an external javascript
file.
//open hint popup
function open_pop_hint(path, targ)
{
litwin = window.open(path,
targ,'width=520,height=200,toolbar=no,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
if
(parseFloat(navigator.appVersion.substring(0,navigator.appVersion.indexOf("
")))>=3.0)
{
litwin.focus();
}
}
Any help would be greatly appreciated I keep staring at the code and I
dont see where the problem is and I cant find anything on the web about
it. Everything seems to be about how this should work.
PS. the most baffling thing of all is that I used this same code on an
old site and it worked as expected.
thanks in advance