ekendra
10-03-2003, 11:22 AM
Hello all.
I have a JS problem here that's got my brain in a knot.
My JS pop-up script goes like this:
<script>
// pop up function called by dynamic 'listen' links below
var newwindow = '';
function openpopup(outURL) {
if (!newwindow.closed && newwindow.location)
{
newwindow.location.href = outURL;
}
else
{
newwindow=window.open(outURL,'name','left=150,top=200,width=300,height=150,scrollbars=no');
if (!newwindow.opener) newwindow.opener = self;
}
if (window.focus) {newwindow.focus()}
return false;
}
</script>
I guess that's pretty straightforward. The variable that's passed into this function comes from a PHP variable plugged into an "onClick" call in a text link.
The problem comes not the first time a link is clicked. (the pop-up opens fine, does what its supposed to do). Not the second time a link is clicked (once again it works fine.) The problem comes when the pop up function has to open a new window the third time. What happens is : the links on the calling page go dead. (try downloading something afterwards - no luck) and the pop-dosen't do what it is supposed to do.
try it out live if you like:
http://www.devaswami.net/audio.php
If links are clicked consecutively without having to open a new window (stuff is just passed into the already open pop-up) then there is no problem. Only when closing and opening the pop-up on the thrid try does the thing pack itself.
any clues? :confused:
i've included the original PHP script if you'd like a better looka t this.
,
ekendra
http://www.devaswami.net/audio.php
I have a JS problem here that's got my brain in a knot.
My JS pop-up script goes like this:
<script>
// pop up function called by dynamic 'listen' links below
var newwindow = '';
function openpopup(outURL) {
if (!newwindow.closed && newwindow.location)
{
newwindow.location.href = outURL;
}
else
{
newwindow=window.open(outURL,'name','left=150,top=200,width=300,height=150,scrollbars=no');
if (!newwindow.opener) newwindow.opener = self;
}
if (window.focus) {newwindow.focus()}
return false;
}
</script>
I guess that's pretty straightforward. The variable that's passed into this function comes from a PHP variable plugged into an "onClick" call in a text link.
The problem comes not the first time a link is clicked. (the pop-up opens fine, does what its supposed to do). Not the second time a link is clicked (once again it works fine.) The problem comes when the pop up function has to open a new window the third time. What happens is : the links on the calling page go dead. (try downloading something afterwards - no luck) and the pop-dosen't do what it is supposed to do.
try it out live if you like:
http://www.devaswami.net/audio.php
If links are clicked consecutively without having to open a new window (stuff is just passed into the already open pop-up) then there is no problem. Only when closing and opening the pop-up on the thrid try does the thing pack itself.
any clues? :confused:
i've included the original PHP script if you'd like a better looka t this.
,
ekendra
http://www.devaswami.net/audio.php