I have opened a new window with JavaScript:
var newwin = window.open(\'\',\'preview\',\'width=600,height=500\');
Now I want to write some J
Your code running ok on my Firefox 3.7, Opera 10, and IE6, but you could try different approach by using DOM functions.
var newwin = window.open('','preview','width=600,height=500');
function sayHi(){
alert('Hi!');
}
var script = newwin.document.createElement("script");
script.type = "text/javascript";
script.textContent = "(" + sayHi + ")();";
newwin.document.body.appendChild(script);
If its not working, you should double check popup blockers or javascript blockers on your browser.
function SetContent()
{
$(newwin).find('#content').html('New Text');
}