Click to See Complete Forum and Search --> : pop up windows multiple


earth2mac
09-27-2005, 02:50 PM
How to have multiple links on a single page and each will go to it's own popup window? This is the code I have used, but how to get other links with seperate ones:

This is in the head:
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
theUrl="test.html";
function doThePopUp() {
reWin = window.open(theUrl,'determined','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollba rs=no,resizable=no,width=200,height=300,top=100,left=100');
}
// End -->
</script>
</HEAD>

This is the link:
<BODY>
<a href="javascript:doThePopUp()">Click here for test</a>

In popup page:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
lockU = 1
function doAgain() {
if (lockU == 1) {
reWin=window.open(theUrl,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=n o,resizable=no,width=530,height=435,top=100,left=100')
}
}
// End -->
</script>

It works just for this one...

LAZARUS
09-27-2005, 02:59 PM
Try replacing this line:

reWin = window.open(theUrl,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=n o,resizable=no,width=200,height=300,top=100,left=100');
}

The seconf parameter for the window.open method tells the target. "_blank" is a "reserved" word which tells the browser to open in a blank page. It was set to 'determined' before, so everytime you click, it opens a popup and calls it "determined". If you click again, a window called "determined" is already opened, so it will be reused.

earth2mac
09-27-2005, 04:13 PM
some clarification in coding. Do you mean keep first line and use this below that with: '_blank' in it? Can you write out complete code on how it should be written so it makes more sense. It's a new script for me, just confusing some... Thnx..