Compare Revisions

Printing

Change Revisions

Revision 365549:

Revision 365549 by ethertank on

Revision 385923:

Revision 385923 by fusionchess on

Title:
Printing
Printing
Slug:
Printing
Printing
Tags:
"NeedsContent", "DOM", "NeedsTechnicalReview", "printing", "NeedsRelocation"
"NeedsContent", "DOM", "NeedsTechnicalReview", "printing", "NeedsRelocation"
Content:

Revision 365549
Revision 385923
t92  <meta http-equiv="Content-Type" content="text/html; charset=t92<meta http-equiv="Content-Type" content="text/html; charset=UT
>UTF-8" />>F-8" />
93  <title>MDN Example</title>93<title>MDN Example</title>
94  <script type="text/javascript">94<script type="text/javascript">
95function closePrint () {
96  document.body.removeChild(this.__container__);
97}
98 
99function setPrint () {
100  this.contentWindow.__container__ = this;
101  this.contentWindow.onbeforeunload = closePrint;
102  this.contentWindow.onafterprint = closePrint;
103  this.contentWindow.print();
104}
105 
95    function printPage (sURL) {106function printPage (sURL) {
96      var oHiddFrame = document.createElement("iframe");107  var oHiddFrame = document.createElement("iframe");
97      oHiddFrame.src = sURL;108  oHiddFrame.onload = setPrint;
98      oHiddFrame.style.visibility = "hidden";109  oHiddFrame.style.visibility = "hidden";
99      oHiddFrame.style.position = "fixed";110  oHiddFrame.style.position = "fixed";
100      oHiddFrame.style.right = "0";111  oHiddFrame.style.right = "0";
101      oHiddFrame.style.bottom = "0";112  oHiddFrame.style.bottom = "0";
113  oHiddFrame.src = sURL;
102      document.body.appendChild(oHiddFrame);114  document.body.appendChild(oHiddFrame);
103      oHiddFrame.contentWindow.onload = oHiddFrame.contentWindow.115}
>print; 
104      oHiddFrame.contentWindow.onafterprint = function () { docum
>ent.body.removeChild(oHiddFrame); }; 
105    }
106  </script>116</script>

Back to History