Click to See Complete Forum and Search --> : conditional popup code from body in netscape


alanc
12-31-2003, 05:40 PM
This code is in a php if statement in the body of a .php page (ie not within the body tag)
It works well in IE but fails in Netscape - why? What is correct code for Netscape browser.

<body>
if ($count > 0){
<script language="javascript">
window.open("http://www.google.com","","width=400,height=300,left=245")
</script>
}
</body>

fredmv
12-31-2003, 05:57 PM
Welcome to the forums.

That syntax is correct for either browser, however, I'm guessing you're not seeing it in Mozilla because it blocks unrequested pop-up windows. ;)

alanc
12-31-2003, 06:07 PM
fredmv , you seem to be the main man with good solutions.

you wrote
Mozilla because it block unrequested pop-up windows

is this by default setup, if so I do wish to push the popup so unrequested popups needs to be enabled. How ?

fredmv
12-31-2003, 06:10 PM
Originally posted by alanc
you seem to be the main man with good solutions.Thanks. ;)Originally posted by alanc is this by default setup, if so I do wish to push the popup so unrequested popups needs to be enabled. How ? You basically have two options: Make it so the user has to perform some kind of action for the new window to open (such as clicking a link, etc.). Request that the user must temporarily disable the pop-up blocking in their browser by using a script I wrote in this thread (http://forums.webdeveloper.com/showthread.php?s=&threadid=24372).