Snippet
<html>
<head>
<script type="text/javascript">
var pop0=null;
function customSetup(URL,name,param,title)
{
winbody=newWindow(URL,name,param,title);
newElement('div',winbody,"this is my inner HTML!");
}
function newWindow(URL,name,param,title)
{
if (URL==null) URL='';
win=window.open(URL,name,param);
windoc=win.document;
windoc.write("<html><head><title>"+title+"</title></head>");
windoc.write("<body></body></html>");
windoc.close();
winbody=windoc.getElementsByTagName('body')[0];
if (pop0==null) pop0=windoc;
return winbody;
}
function newElement(tag,node,iHTML)
{
element=pop0.createElement(tag);
if (iHTML!=null)
element.innerHTML=iHTML;
node.appendChild(element);
}
</script>
</head>
<body onLoad="customSetup(null,'newWin','width=250,height=250','My Title!');">
</body>
</html>
Copy & Paste
|