Log in

View Full Version : autoprint is working in IE and is printing a empty page in FF



thebosdj
11-26-2006, 01:42 AM
Hy, :)
This script is working very good in IE and there is a perfect print.
When i try it under FF than is everything good accept the empty page
(only time, date, name and page number) :mad:

Can somebody help to fix this please :confused:

THE SCRIPT




<script type="text/javascript">
<!--
function autoprint()
{
F1 =
window.open("1.htm","_blank","width=310,height=400,left=0,top=0");

F1.focus();
F1.print();
F1.close();
}
//-->
</script>




<a href="javascript:autoprint()";>print</a>

thebosdj
11-26-2006, 08:54 PM
Still no solution :eek:

thetestingsite
11-26-2006, 09:39 PM
can you post a link so that we may look at it in action?

thebosdj
11-26-2006, 09:57 PM
see it in action:
http://webbee.be/print

see the printing page:
http://webbee.be/print/1.htm

thetestingsite
11-26-2006, 10:22 PM
I have looked it over, and come to a solution. Try the following:

test.html



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Testing autoprint</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script type="text/javascript">
<!--
function autoprint()
{

F1 = window.open("1.htm","_blank","width=310,height=400,left=0,top=0");

F1.focus();
}
//-->
</script>

</head>

<body>
<div align="center">
<p><img src="1.gif" width="207" height="248" border="1"></p>

</div>
<div align="center"><a href="javascript:autoprint()";>print</a> </div>
</body>
</html>


1.htm



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="JavaScript">
<!--

window.print();
window.close();

//-->
</script>
<title>Printing page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<div align="center"><img src="1.gif" width="600" height="800">
</div>
</body>
</html>


I have tested it in both FF and IE and it seems to do what it's supposed to. Let me know if this helps you out.

thebosdj
11-26-2006, 10:59 PM
A big thank you.
This is the solution i needed! :D :D