newbiedude
07-15-2003, 07:28 PM
hello,
I'm having a hard time combining functions. I wish to have one button which will do both:
close a popup window (basically an 'agree' page) and
redirect the parent window to a desired URL
I've tried several iterations of things, but continue to get poor behavior. The parent redirect works, but the popup does not close. For instance,
<SCRIPT Language="javascript" type="text/javascript">
<!-- close this window and change parent window to new URL
newWindow = null
function updateParent(newURL) {
opener.document.location = newURL;
if (newWindow && !newWindow.closed) {
newWindow.close()
}
}
// end hiding script -->
</script>
Within the body of my page, I attempt to
<form>
<input type=button value="I Agree" onClick="updateParent('thumbnails.htm?c=cool&y=yes')">
</form>
It should be obvious to me, but it isn't. Any help would be wonderful.
confounded.
I'm having a hard time combining functions. I wish to have one button which will do both:
close a popup window (basically an 'agree' page) and
redirect the parent window to a desired URL
I've tried several iterations of things, but continue to get poor behavior. The parent redirect works, but the popup does not close. For instance,
<SCRIPT Language="javascript" type="text/javascript">
<!-- close this window and change parent window to new URL
newWindow = null
function updateParent(newURL) {
opener.document.location = newURL;
if (newWindow && !newWindow.closed) {
newWindow.close()
}
}
// end hiding script -->
</script>
Within the body of my page, I attempt to
<form>
<input type=button value="I Agree" onClick="updateParent('thumbnails.htm?c=cool&y=yes')">
</form>
It should be obvious to me, but it isn't. Any help would be wonderful.
confounded.