Hi there,
Trying to teach myself some js. Have a script that launches a popup when the parent loads. I have used onblur='self.focus();' in the function that writes the new window. While the onblur writes itself into the popups body tag as instructed, it doesn't work. Anyone have any idea how I can get this to work. The function is below:
<SCRIPT LANGUAGE="JavaScript">
function openindex()
{
var OpenWindow=window.open("", "newwin", "height=300,width=300");
OpenWindow.document.write("<html>")
OpenWindow.document.write("<title>New Window</title>")
OpenWindow.document.write("<body onblur='self.close();'>")
OpenWindow.document.write("<div align='center'>")
OpenWindow.document.write("<h1>New Window</h1>")
OpenWindow.document.write("<p>This will open<BR> in the main window</a></p>")
OpenWindow.document.write("<p><hr width='60%'></p>")
OpenWindow.document.write("<p><a href='' onclick='self.close()'> This closes the window</a></p>")
OpenWindow.document.write("</div>")
OpenWindow.document.write("</body>")
OpenWindow.document.write("</html>")
}
</SCRIPT>
Trying to teach myself some js. Have a script that launches a popup when the parent loads. I have used onblur='self.focus();' in the function that writes the new window. While the onblur writes itself into the popups body tag as instructed, it doesn't work. Anyone have any idea how I can get this to work. The function is below:
<SCRIPT LANGUAGE="JavaScript">
function openindex()
{
var OpenWindow=window.open("", "newwin", "height=300,width=300");
OpenWindow.document.write("<html>")
OpenWindow.document.write("<title>New Window</title>")
OpenWindow.document.write("<body onblur='self.close();'>")
OpenWindow.document.write("<div align='center'>")
OpenWindow.document.write("<h1>New Window</h1>")
OpenWindow.document.write("<p>This will open<BR> in the main window</a></p>")
OpenWindow.document.write("<p><hr width='60%'></p>")
OpenWindow.document.write("<p><a href='' onclick='self.close()'> This closes the window</a></p>")
OpenWindow.document.write("</div>")
OpenWindow.document.write("</body>")
OpenWindow.document.write("</html>")
}
</SCRIPT>