I have this code to open a new window and pass a div's content into a div in the new window:
<script type="text/javascript">
var changeIt, print_div;
changeIt = function()
{ print_div = document.getElementById("sec_content").innerHTML;
newwindow=window.open( 'targetpage.html', target="_blank" );
setTimeout('newwindow.document.getElementById("print_content").innerHTML=print_div',100)
};
</script>
but for some reason it's not working online (it does open a new window but it doesn't pass the sec_content into print_content) , it only does when I use an alert before the setTimeout, like this:
<script type="text/javascript">
var changeIt, print_div;
changeIt = function()
{ print_div = document.getElementById("sec_content").innerHTML;
newwindow=window.open( 'targetpage.html', target="_blank" );
alert("eeeaaa");
setTimeout('newwindow.document.getElementById("print_content").innerHTML=print_div',100)
};
</script>
Can anyone tell me why please, I really need help with this.