You are here: irt.org | FAQ | JavaScript | Window | Q1228 [ previous next ]
If the page you open comes from another server forget it. Otherwise try:
<script language="JavaScript"><!--
var popUp_Window = ""; // make it global
function popUpWindow(pagename) {
popUp_Window = window.open(pagename,"pop_up","width=349,height=410");
if (window.focus) setTimeout('popUp_Window.focus()',1000);
}
//--></script>However a much safer (and instant) method is to put this in the page you open:
<body onLoad="if (window.focus) self.focus()">