By here, I mean on my trusty laptop running Windows XP Home with live update and IE6 and FF1.0.7. Like I said. I put your code on a page and ran it in both browsers. It did fine with simple things like:
K
and
<span>Hi!</span>
I even pasted in the code of the page itself, hit 'write' and then I had two of them. The second version wouldn't run until I changed child to child2 in the textarea, for obvious reasons (it was overwriting itself). Once I fixed that, the spawned copy worked just like the original. Here is the exact code I used (it is really just exactly what you posted, pasted into my standard HTML 'blank'):
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<div><textarea></textarea></div>
<div><button onclick="win = window.open ('', 'child', 'height=400,width=300'); win.document.write (document.getElementsByTagName ('TEXTAREA')[0].value); win.document.close(); win.focus()">Write</button></div>
</body>
</html>
I'm really at a loss as to what could be the problem on your end. Try my (really it is your) code and see if that makes any difference. Perhaps security or other settings on your browser are the problem or, if you have a different OS or browser than the ones I used.
Bookmarks