Breaking on Jscript Runtime Error in IE8 and IE9
<p>For the first time, i was able to pop up the windows with the element "this is my inner HTML!", but after i have closed the pop windows, and retry to pop the windows again, it hitting the error at this line " element=pop0.createElement(tag)".</p>

<p>Any help appreciated.</p>

<p>here is the code.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript"&gt;

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("&lt;html&gt;&lt;head&gt;&lt;title&gt;"+title+"&lt;/title&gt;&lt;/head&gt;");
windoc.write("&lt;body&gt;&lt;/body&gt;&lt;/html&gt;");
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);
}

&lt;/script&gt;
&lt;/head&gt;

&lt;input type="button" onClick="customSetup(null,'newWin','width=250,height=250','My     Title!')" value="POP2!"&gt;
</code></pre>

<p>
</p>
