<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Printing contents of a div using javascript</title>
	<atom:link href="http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
	<description>Write easy solutions, provide easy solutions</description>
	<lastBuildDate>Sat, 31 Jul 2010 10:37:34 +0100</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Jaganath</title>
		<link>http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/comment-page-1/#comment-4821</link>
		<dc:creator>Jaganath</dc:creator>
		<pubDate>Sat, 31 Jul 2010 10:37:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/#comment-4821</guid>
		<description>It Works Fine in My Website</description>
		<content:encoded><![CDATA[<p>It Works Fine in My Website</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sin</title>
		<link>http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/comment-page-1/#comment-4531</link>
		<dc:creator>sin</dc:creator>
		<pubDate>Wed, 07 Jul 2010 00:28:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/#comment-4531</guid>
		<description>try giving EnableEventValidation=&quot;false&quot; in page directive</description>
		<content:encoded><![CDATA[<p>try giving EnableEventValidation=&#8221;false&#8221; in page directive</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jet</title>
		<link>http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/comment-page-1/#comment-4524</link>
		<dc:creator>Jet</dc:creator>
		<pubDate>Tue, 06 Jul 2010 13:20:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/#comment-4524</guid>
		<description>Hello!
I&#039;d been trying to print the div content with no luck.
i can&#039;t even capture the innertext nor innerhtml with code (i&#039;m working with asp.net).
In fact what i want to print are the directions produced by google maps for a  given route.
The code kindly posted by msdnExpert breakes here:

WindowObject.document.writeln(DocumentContainer.innerHTML);
The Err Message is:
Microsoft JScript runtime error: Object required

For any help
Thanks a lot.</description>
		<content:encoded><![CDATA[<p>Hello!<br />
I&#8217;d been trying to print the div content with no luck.<br />
i can&#8217;t even capture the innertext nor innerhtml with code (i&#8217;m working with asp.net).<br />
In fact what i want to print are the directions produced by google maps for a  given route.<br />
The code kindly posted by msdnExpert breakes here:</p>
<p>WindowObject.document.writeln(DocumentContainer.innerHTML);<br />
The Err Message is:<br />
Microsoft JScript runtime error: Object required</p>
<p>For any help<br />
Thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay Jay</title>
		<link>http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/comment-page-1/#comment-4102</link>
		<dc:creator>Jay Jay</dc:creator>
		<pubDate>Sun, 06 Jun 2010 07:03:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/#comment-4102</guid>
		<description>It doesn&#039;t work on me. huhuh =(</description>
		<content:encoded><![CDATA[<p>It doesn&#8217;t work on me. huhuh =(</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aamir Shahzad</title>
		<link>http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/comment-page-1/#comment-3460</link>
		<dc:creator>Aamir Shahzad</dc:creator>
		<pubDate>Mon, 22 Mar 2010 06:41:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/#comment-3460</guid>
		<description>Assalam-u-Alaikum,

I find this very helpful,
thanks buddy
&lt;!–
function ClickHereToPrint(){
try{
var oIframe = document.getElementById(‘ifrmPrint’);
var oContent = document.getElementById(‘divToPrint’).innerHTML;
var oDoc = (oIframe.contentWindow &#124;&#124; oIframe.contentDocument);
if (oDoc.document) oDoc = oDoc.document;
oDoc.write(“title”);
oDoc.write(“”);
oDoc.write(oContent + “”);
oDoc.close();
}
catch(e){
self.print();
}
}
// –&gt;</description>
		<content:encoded><![CDATA[<p>Assalam-u-Alaikum,</p>
<p>I find this very helpful,<br />
thanks buddy<br />
&lt;!–<br />
function ClickHereToPrint(){<br />
try{<br />
var oIframe = document.getElementById(‘ifrmPrint’);<br />
var oContent = document.getElementById(‘divToPrint’).innerHTML;<br />
var oDoc = (oIframe.contentWindow || oIframe.contentDocument);<br />
if (oDoc.document) oDoc = oDoc.document;<br />
oDoc.write(“title”);<br />
oDoc.write(“”);<br />
oDoc.write(oContent + “”);<br />
oDoc.close();<br />
}<br />
catch(e){<br />
self.print();<br />
}<br />
}<br />
// –&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dana</title>
		<link>http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/comment-page-1/#comment-2864</link>
		<dc:creator>Dana</dc:creator>
		<pubDate>Sun, 07 Feb 2010 14:21:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/#comment-2864</guid>
		<description>Hello,

I find this very helpful, but I have 1 problem.
I would like to keep my css styling in the printed form.
The styling is removed when printing.
Is there a way to keep it?

Thank you,
Dana</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I find this very helpful, but I have 1 problem.<br />
I would like to keep my css styling in the printed form.<br />
The styling is removed when printing.<br />
Is there a way to keep it?</p>
<p>Thank you,<br />
Dana</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anhnt</title>
		<link>http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/comment-page-1/#comment-2774</link>
		<dc:creator>anhnt</dc:creator>
		<pubDate>Mon, 01 Feb 2010 02:12:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/#comment-2774</guid>
		<description>Thank!
But, your resolve only deal with label (if i make label change). However with radio or checkbox that status of check is inputted by user or javascript prints unsuccessfully.
I&#039;m using firefox and see that. But IE may be correct. I don&#039;t know the options in firefox and when see on firebug, i see the text (innerHtml) for label inserted in source but check for radio can&#039;t be inserted.</description>
		<content:encoded><![CDATA[<p>Thank!<br />
But, your resolve only deal with label (if i make label change). However with radio or checkbox that status of check is inputted by user or javascript prints unsuccessfully.<br />
I&#8217;m using firefox and see that. But IE may be correct. I don&#8217;t know the options in firefox and when see on firebug, i see the text (innerHtml) for label inserted in source but check for radio can&#8217;t be inserted.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thanksAMillion</title>
		<link>http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/comment-page-1/#comment-1781</link>
		<dc:creator>thanksAMillion</dc:creator>
		<pubDate>Mon, 26 Oct 2009 19:16:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/#comment-1781</guid>
		<description>Also I should note that I&#039;m using inside Drupal... another reason why there were roadblocks...</description>
		<content:encoded><![CDATA[<p>Also I should note that I&#8217;m using inside Drupal&#8230; another reason why there were roadblocks&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thanksAMillion</title>
		<link>http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/comment-page-1/#comment-1780</link>
		<dc:creator>thanksAMillion</dc:creator>
		<pubDate>Mon, 26 Oct 2009 19:15:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/#comment-1780</guid>
		<description>I used Msdnexpert&#039;s code and it works perfectly! I&#039;ve been trying to get this to work for weeks now on and off. Thanks a Million!</description>
		<content:encoded><![CDATA[<p>I used Msdnexpert&#8217;s code and it works perfectly! I&#8217;ve been trying to get this to work for weeks now on and off. Thanks a Million!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Msdnexpert</title>
		<link>http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/comment-page-1/#comment-1051</link>
		<dc:creator>Msdnexpert</dc:creator>
		<pubDate>Tue, 21 Jul 2009 10:45:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/#comment-1051</guid>
		<description>To print just a div the following code works. Of course you need to replace the id of the div with your id.


function PrintContent()
    {
        var DocumentContainer = document.getElementById(&#039;divtoprint&#039;);
        var WindowObject = window.open(&#039;&#039;, &quot;PrintWindow&quot;, 
                              &quot;width=750,height=650,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=yes&quot;);
        WindowObject.document.writeln(DocumentContainer.innerHTML);
        WindowObject.document.close();
        WindowObject.focus();
        WindowObject.print();
        WindowObject.close();
    }</description>
		<content:encoded><![CDATA[<p>To print just a div the following code works. Of course you need to replace the id of the div with your id.</p>
<p>function PrintContent()<br />
    {<br />
        var DocumentContainer = document.getElementById(&#8216;divtoprint&#8217;);<br />
        var WindowObject = window.open(&#8221;, &#8220;PrintWindow&#8221;,<br />
                              &#8220;width=750,height=650,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=yes&#8221;);<br />
        WindowObject.document.writeln(DocumentContainer.innerHTML);<br />
        WindowObject.document.close();<br />
        WindowObject.focus();<br />
        WindowObject.print();<br />
        WindowObject.close();<br />
    }</p>
]]></content:encoded>
	</item>
</channel>
</rss>
