JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old April 19th, 2004, 04:54 AM
samasamajam samasamajam is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 samasamajam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
window print & close dont work in netscape7.1

I have a requirement where i have to print the page contents in a printable format. For this i have to open the printable format in a new window and issue the print command.
i am using window.open for opening teh new window. In the body tag of the new window i have the following code..
<body onload="javascript:window.print()" onfocus="javascript:window.close()">
With this code i print the page and close the window. This works fine with IE. But with netscape 7.1 the print doesn't work. This is bcoz the window.close is being called even before the print spooling happens. COuld anyone help me with this where i can ensure that spooling of data is complete.

Reply With Quote
  #2  
Old April 19th, 2004, 08:50 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Why not just call the window.close() method after printing. That way, after the print dialog has been closed, the page will close.
E.g. <body onload="window.print();window.close();">
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old April 21st, 2004, 03:37 AM
samasamajam samasamajam is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 samasamajam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have tried the following code in netscape 7.1. But the printing still doesn't happen.
<body onload="window.print();window.close();">
The popup window closes before printing.

Reply With Quote
  #4  
Old April 21st, 2004, 04:07 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Hmm - interesting. What does happen using my suggestion?
Do some tests to see what's going on, and in what order by placing some debugging alert()'s in the onload... maybe the window.close method is being called incorrectly (before the print dialog is finished)?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > window print & close dont work in netscape7.1


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway