Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1086 Problems when printing

irt.org | Knowledge Base | JavaScript | Bugs | Q1086 [ previous next ]

Q1086 Problems when printing

Symptom: Trying to print a page that
1. writes content based on a prompt and a cookie writes the wrong data or
2. trying to print a frame that has a framing script gives a frame was empty error

Affects: Netscape Communicator 4 4.06+

Reason: Netscape re-renders the page before printing - a cookie using a domain, will get a different cookie back because Netscape emulates a user. It also executes any scripts found on the page...

Workaround: The following works:

NowPrinting = false;
if (document.layers && self.innerWidth==0 && self.innerHeight==0) NowPrinting=true; // Hack for printing 
// Now we can use it to test before executing scripts like this:
if (!NowPrinting && top.location.href.indexOf("frameset.html") == -1)
  top.location.href = "frameset.html?frame1.html";

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.