Javascript pop up window help
Permalink
Hi all,
I'm using a zip code locator program and I want the locator to open in a pop up window when a link is clicked. The program's documentation says to put the following code into the head section to accomplish this:
<SCRIPT LANGUAGE="JavaScript">
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
</script>
This is the code given for the link to the pop up window:
<a href="http://66.147.244.126/~naponcor//locator/index.php" onclick="NewWindow(this.href,'locator','330','400','yes');return false;">Search Form</a>
For some reason the locator opens in the same browser window. Can anyone tell me what the issue could be?
Thanks in advance,
John
I'm using a zip code locator program and I want the locator to open in a pop up window when a link is clicked. The program's documentation says to put the following code into the head section to accomplish this:
<SCRIPT LANGUAGE="JavaScript">
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
</script>
This is the code given for the link to the pop up window:
<a href="http://66.147.244.126/~naponcor//locator/index.php" onclick="NewWindow(this.href,'locator','330','400','yes');return false;">Search Form</a>
For some reason the locator opens in the same browser window. Can anyone tell me what the issue could be?
Thanks in advance,
John
Thanks, but I don't want to use an iframe. How would I get the iframe to open in a pop up window?
I tried the code on a regular (not concrete5 ) page and the pop up script worked fine. I don't know why implementing this with C5 would be an issue.
I tried the code on a regular (not concrete5 ) page and the pop up script worked fine. I don't know why implementing this with C5 would be an issue.
Boy, do I feel dumb. All I had to do was use the C5 default pop up window tab in the content block.
Often browser settings prevent new windows from opening.