window.open function load CSS
Is there any way to load CSS during pop up a window?
function kmt_ShowBoxPopup(targetDivID, aTag)
{
var orgin_div_content=document.getElementById(targetDivID).innerHTML;
//alert(targetDivID);
showBoxPopupWin =window.open("",targetDivID,'height=400,width=710,screenX=250,screenY=80, scrollbars=yes');
showBoxPopupWin.document.write ('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">'+
'<html><head><title>'+targetDivID+'</title></head><body>'+orgin_div_content+'</body</html>');
if (window.focus) {showBoxPopupWin.focus()}
}
<a class="cs_popuplink" onclick="kmt_ShowBoxPopup('BOX02_01',this); return false; ">show me how..</a>
<div id = "BOX02_01" STYLE=display:none>
p
p
p
</div>
Here is my code. I would like to load a CSS in showBoxPopupwin.document.write function. Is it possible?
cheers开发者_如何学C, Qing
Why not just write a <link href="your.css" ... />
just like you're writing the rest of the HTML?
Just add a link
element before </head>
just as you would in any other HTML document.
Sure, just output a normal link
tag in the HTML you're writing.
精彩评论