Web Hosting Talk







View Full Version : How do you popup a php file?


latheesan
08-17-2005, 03:18 PM
Hi,

i tried to popup a php file without any features like menubar, scrollbar, and so on and centerterd too, so i tried to use this script. it didnt work :(


<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=511,height=304,left=278,top=238');");
}
// End -->
</script>
</head>
<body>
<a href="javascript:popUp('list.php')">Open the list</a>
</body>


why isnt it working?

opera.mp3
08-17-2005, 06:56 PM
I figure this will work:
function popUp(URL) {
return window.open(URL, '_blank', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=511,height=304,left=278,top=238');
}

and.. the reason why the code you posted didn't working is because it was trying to use the variable 'id' (which may have actually been a global variable in the code you took it from) was undefined. on an unrelated note, it was unnecessarily using eval().

latheesan
08-18-2005, 05:55 PM
Thanks opera,

I'll try your suggestion.