Hello,
Can someone plese tell me what I am doing wrong here. I'm trying to print the page using window.print() but it doesn't work.
Thanks in advance.
Can someone plese tell me what I am doing wrong here. I'm trying to print the page using window.print() but it doesn't work.
Code:
<script language=javascript>
function myTest(){
var win = window.open("", "", "resizable=no,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,copyhistory=0,width=720,height=300");
win.document.writeln("<html>\n");
win.document.writeln("<head>\n");
win.document.writeln("<title> </title>\n");
win.document.writeln("</head>\n");
win.document.writeln("<body>\n");
win.document.writeln("<form>\n");
win.document.writeln("<input type='submit' style='cursor:hand' onClick='window.print()' value='Print'>");
win.document.writeln("<input type='button' style='cursor:hand' onclick='window.close()' value='Cancel'>");
win.document.writeln("<br>C'mon print something!!! \n");
win.document.writeln("<br> \n");
win.document.writeln("</form>");
win.document.writeln("</body>");
win.document.writeln("</html>");
}
</script>
<input type="button" value="print me" onclick="myTest()">
Thanks in advance.