<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shuvalov Lev &#187; tag</title>
	<atom:link href="http://shuvalov.com/tag/tag/feed/" rel="self" type="application/rss+xml" />
	<link>http://shuvalov.com</link>
	<description>system administrator</description>
	<lastBuildDate>Fri, 20 Apr 2012 09:24:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>print page JavaScript</title>
		<link>http://shuvalov.com/print-page-javascript/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=print-page-javascript</link>
		<comments>http://shuvalov.com/print-page-javascript/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 07:05:21 +0000</pubDate>
		<dc:creator>Lev Shuvalov</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.shuvalov.com/?p=268</guid>
		<description><![CDATA[There is a JavaScript funcion into the HEAD tag. This funtion force to initiate printing process of your browser therefore its behaving depends on the browser. &#60;head&#62; &#60;link rel='stylesheet' type='text/css' href='/include/screen.css' media='screen' /&#62; &#60;link rel='stylesheet' type='text/css' href='/include/print.css' media='print, handheld' /&#62; &#60;script language="JavaScript"&#62; function print_overall(){ window.print(); } &#60;/script&#62; &#60;/head&#62; Somewhere in the body of HTML document [...]]]></description>
			<content:encoded><![CDATA[<p>There is a JavaScript funcion into the HEAD tag. This funtion force to initiate printing process of your browser therefore its behaving depends on the browser.</p>
<pre>&lt;head&gt;
&lt;link rel='stylesheet' type='text/css' href='/include/screen.css' media='screen' /&gt;
&lt;link rel='stylesheet' type='text/css' href='/include/print.css' media='print, handheld' /&gt;

&lt;script language="JavaScript"&gt;
function print_overall(){
 window.print();
}
&lt;/script&gt;
&lt;/head&gt;</pre>
<p>Somewhere in the body of HTML document should be a call of that funtion. Like that:</p>
<pre>&lt;div class="print"&gt;
&lt;form&gt;
  &lt;input type="button" value="Print this page" onclick="print_overall()"&gt;
&lt;/form&gt;
&lt;/div&gt;</pre>
<p>You can combine the function declaration and call</p>
<pre>&lt;div class="print"&gt;
&lt;form&gt;
  &lt;input type="button" value="Print this Page" onClick="window.print()" /&gt;
&lt;/form&gt;
&lt;/div&gt;</pre>
<p>or</p>
<pre>
&lt;span class="print"&gt;
  &lt;a href="JavaScript:window.print();"&gt;Print this page&lt;/a&gt;
&lt;/span&gt;
</pre>
<p>The class &#8220;print&#8221; I use to hide printing elements on a hard copy of the document.</p>
<pre>
/*=========================================================== screen.css */
.print {
  text-align:center;
}
/*=========================================================== print.css */
.print {
  visibility: hidden;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://shuvalov.com/print-page-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

