Current location: Hot Scripts Forums » General Web Coding » JavaScript » autoprint is working in IE and is printing a empty page in FF


autoprint is working in IE and is printing a empty page in FF

Reply
  #1 (permalink)  
Old 11-26-06, 07:14 AM
thebosdj thebosdj is offline
New Member
 
Join Date: Nov 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy autoprint is working in IE and is printing a empty page in FF

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)

Can somebody help me to fix this please

THE SCRIPT
Code:
<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>

Last edited by Nico; 11-26-06 at 10:24 AM. Reason: Please use [code] wrappers when posting code.
Reply With Quote
  #2 (permalink)  
Old 11-26-06, 01:50 PM
reportingsjr reportingsjr is offline
Newbie Coder
 
Join Date: Aug 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
<a href="javascript:autoprint()";>print</a>
Put that semicolon in the right place and it will work!
Reply With Quote
  #3 (permalink)  
Old 11-26-06, 02:45 PM
thebosdj thebosdj is offline
New Member
 
Join Date: Nov 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
That is already in the right place off course!
So that is not the problem!!!!!!

How can it else works under IE?
Reply With Quote
  #4 (permalink)  
Old 11-26-06, 02:47 PM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
no it's not in the right place: this is the right place:
Quote:
<a href="javascript:autoprint();">print</a>
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
  #5 (permalink)  
Old 11-26-06, 03:02 PM
thebosdj thebosdj is offline
New Member
 
Join Date: Nov 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
yeah ok but it is not the solution for the problem

see it in action:
http://webbee.be/print

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

Last edited by thebosdj; 11-26-06 at 03:59 PM.
Reply With Quote
  #6 (permalink)  
Old 11-27-06, 06:26 PM
thebosdj thebosdj is offline
New Member
 
Join Date: Nov 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
this the solution i get from someone

MAIN PAGE
Quote:
<!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>

PRINTING PAGE
Quote:
<!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>
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 11:21 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.