The following function is called by a “print” button on my page. The new window is opening and the page is rendering. However, IE seems to get hung trying to re-download the stylesheet or an image or something. Netscape 7 just continues to spin (load) although I have no clue what action it’s trying to perform. I can’t view the page source, which make me think the page isn’t finished loading. The source comes up and appears correct in IE.
Any help would be appreciated.
function printSp1()
{
if (document.getElementById != null)
{
var html = ‘<HTML>n<HEAD>n’;
if (document.getElementsByTagName != null)
{
var headTags = document.getElementsByTagName(“head”);
//if (headTags.length > 0)
// html += headTags[0].innerHTML;
}
html +=’n<link rel=”stylesheet” href=”/css/style.css” type=”text/css”>n’;
html += ‘n</HEAD><BODY>n’;
var printReadyElem = document.getElementById(“printReady”);
if (printReadyElem != null)
{
html += printReadyElem.innerHTML;
}
else
{
alert(“Could not find the printReady section in the HTML”);
return;
}
alert(html);
html += ‘n</BODY></HTML>n’;
var storyWin = window.open(“”,
“StoryWin”,
“toolbar=yes,width=900,height=400,status=yes,scrollbars=yes,menubar=yes”);
with (storyWin.document) {
write(html);
}
}
else
{
alert(“Sorry, the print ready feature is only available in modern browsers.”);
}
}