This is probably an easy question for some of you but I’m having some issues here…
I’ve set up a script to close my pop-up window when the user clicks back onto the main page (so they don’t end up with dozens of pop-up windows lying around). The script works fine, but there’s a script error when the page is initially loaded:
“Object doesn’t support this property or method”.
I don’t think the variable called “pop” is getting initialized before the pop.close() script it run, causing an error.
Here’s the chunk of code:
[quote]
<head>
<script language=”Javascript”>
<!– Hide script from old browsers
var pop;
function popUp(URL,w,h){
pop = window.open(URL,”win1″,”width=”+w+”,height=”+h+”,resizable=0,scrollbars=1″)
}
// End hiding script from old browsers –>
</script>
</head>
<body onFocus=”pop.close()”>
and so on….
The real page is here: www.rnkvoip.com/testlinks.html