Hello,
When I run this script:
<script language="Javascript">
function openWin() {
var iptWin = window.open('somePage.html', 'newWindow', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=375,height=325');
setTimeout('focusWin()',250);
}
function focusWin() {
iptWin.focus();
}
</script>
I get the following error:
iptWin not defined
It draws the error when I try to set the focus within the setTimeout function. When I set the focus without the setTimeout function, there's no error. I need to use the setTimeout function because without it, sometimes the new window loads behind the parent window.
Should I be putting newWindow.focus()?
Why is my window undefined?
Thanks,
Peter
When I run this script:
<script language="Javascript">
function openWin() {
var iptWin = window.open('somePage.html', 'newWindow', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=375,height=325');
setTimeout('focusWin()',250);
}
function focusWin() {
iptWin.focus();
}
</script>
I get the following error:
iptWin not defined
It draws the error when I try to set the focus within the setTimeout function. When I set the focus without the setTimeout function, there's no error. I need to use the setTimeout function because without it, sometimes the new window loads behind the parent window.
Should I be putting newWindow.focus()?
Why is my window undefined?
Thanks,
Peter