I have some very simple javascript code that looks like this:
var newWindow = window.open("","");
if (newWindow != null)
{
newWindow.document.write("<HTML><HEAD><TITLE>hi</TITLE></HEAD>");
newWindow.document.close();
}
document.getElementById('status1').innerHTML = "opened a new window";
But for some reason the document.getElementById… part never gets called. Is this expected, or am I doing something wrong? (Yes, status1 is defined)
As Guffa says, look for an error message.
newWindow.documentis possibly null or undefined, since it may take longer to open the window than to executenewWindow != null.