Forum Moderators: open
In my example code, the first method recognizes onBlur properly and the popup stays on top. Because the contents are from and external file however, the method won't work in my application. The second method creates exactly the same popup window using document.write's. In this case, onBlur never fires.
What can I do to get the second method to work like the first?
Thanks.
Source of Test1.html:
<script type="text/javascript">
function openWin() {
var popWin = window.open("Test2.html", "popWin", "width=300, height=150");
}function createWin() {
var popWin = window.open("", "popWin", "width=300, height=150");
popWin.document.writeln("<body onblur='window.focus();'>");
popWin.document.writeln("<p>Some Stuff</p>");
popWin.document.writeln("</body>");
}
</script><a href="#" onclick="openWin(); return false;">Open the Popup</a><br />
<a href="#" onclick="createWin(); return false;">Create the Popup</a>
Source of Test2.html:
<body onblur='window.focus();'>
<p>Some Stuff</p>
</body>