Hi All,

For the first pop i was able to pop up the windows with the element "this is my inner HTML!", but after i close the pop windows, and try to re-pop again, it hitting the error at this line " element=pop0.createElement(tag)".

Any help appreciated.

here is the code.

<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>

<input type="button" onClick="customSetup(null,'newWin','width=250,height=250','My Title!')" value="POP2!">

</body>
</html>