0

guys please help me how can I print the contents of my div in mozilla because it runs properly in opera mini and google chrome, well actually it still prints but the only content is "undefined" instead of the real contents of the div
this is my codes

<head>
<script type="text/javascript">
<!--
function printDiv() 
{ 
  var divToPrint=document.getElementById('content'); 
  var newWin=window.open('','Print-Window','width=100,height=100'); 
  newWin.document.open(); 
  newWin.document.write('<html><body onload="window.print()">'+content.innerHTML+'</body></html>'); 
  newWin.document.close(); 
  setTimeout(function(){newWin.close();},10); 
 }
//-->
</script>
</head>

<div id="content">
(contents)
</div>
<input name="button" type="button" onClick="printDiv()" value="print" />
2
Contributors
4
Replies
5
Views
4 Years
Discussion Span
Last Post by Ctechnology24
0

Sorry because I am new in javascript, thats why I cant understand how to integrate that @media function in my work :( can you give me some hints how can I apply that in my current codes?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.