...

View Full Version : window.print() not working in IE7



nikos101
05-29-2009, 12:39 PM
The following code outputs a button that prints fine in firefox but not in IE7

function printPage(htmlPage)
{
var w = window.open("about:blank");
w.document.write(htmlPage);
w.document.write("<br><form><input type='button' value=' Print this page 'onclick='window.print(); ;return false' /></form>");
// w.print();
// w.close();
}

any ideas friends

Kor
05-29-2009, 01:16 PM
Maybe you should use the quotes in standard way. And leave spaces between attributes. And you have 2 semicolons. In fact you need no one, as the return false is useless.Try this:


w.document.write('<br><form><input type="button" value=" Print this page " onclick="window.print()" /></form>');

nikos101
05-29-2009, 01:55 PM
thanks but no luck with that


<script language="JavaScript">
function printPage(htmlPage)
{
var w = window.open("about:blank");
w.document.write(htmlPage);

w.document.write('<br><form><input type="button" value=" Print this page " onclick="window.print()" /></form>');
// w.print();
// w.close();
}
</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum