<?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/"
	>

<channel>
	<title>HTMLTree - A Growing Repository for Web Designers and Developers</title>
	<atom:link href="http://htmltree.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://htmltree.com</link>
	<description>A Growing Repository for Web Designers and Developers</description>
	<pubDate>Thu, 03 Dec 2009 04:26:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Free WordPress Theme - Playground</title>
		<link>http://htmltree.com/free-wordpress-theme-playground/</link>
		<comments>http://htmltree.com/free-wordpress-theme-playground/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 04:06:12 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[download]]></category>

		<category><![CDATA[free]]></category>

		<category><![CDATA[psd]]></category>

		<category><![CDATA[theme]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://htmltree.com/?p=102</guid>
		<description><![CDATA[So my first attempt at a WordPress theme on ThemeForest failed. Oh well, that means you lucky folks get it for free!
I mean, I worked so hard to get it ready for the public&#8230; and since it&#8217;s been rejected, that means you guys can have it. Enjoy!

Online demo.
View the tutorial / setup.
Download the theme with [...]]]></description>
			<content:encoded><![CDATA[<p>So my first attempt at a WordPress theme on ThemeForest failed. Oh well, that means you lucky folks get it for free!</p>
<p>I mean, I worked so hard to get it ready for the public&#8230; and since it&#8217;s been rejected, that means you guys can have it. Enjoy!</p>
<p><a href='http://awesomevsawesome.com/playground/wordpress/'><img src='http://awesomevsawesome.com/playground/screenshot1.png' alt='playground theme' width='350px'/></a></p>
<p><a href='http://awesomevsawesome.com/playground/wordpress/'>Online demo</a>.</p>
<p><a href='http://awesomevsawesome.com/playground/readme.html'>View the tutorial / setup</a>.</p>
<p><a href='http://htmltree.com/playground_r1.zip'>Download the theme with PSD file</a>.</p>
<p>*Donation are always nice&#8230;</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="VQDJNYHY8PSBG">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Robert Banh">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://htmltree.com/free-wordpress-theme-playground/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Update&#8230;</title>
		<link>http://htmltree.com/update/</link>
		<comments>http://htmltree.com/update/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 01:03:32 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[book]]></category>

		<category><![CDATA[magento]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[themeforest]]></category>

		<guid isPermaLink="false">http://htmltree.com/?p=98</guid>
		<description><![CDATA[It&#8217;s been a while. So what are you up to rob??
Well I&#8217;ve been developing a few PHP scripts for Themeforest, co-authoring a Magento Book that&#8217;s due out in December, and picking up more freelance work.
I also started to catalog some of my code pieces in snipt.
Yes, it&#8217;s true I have no life&#8230; 
]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while. So what are you up to rob??</p>
<p>Well I&#8217;ve been developing a few <a href="http://themeforest.net/user/robertbanh">PHP scripts</a> for Themeforest, co-authoring a <a href="http://www.amazon.com/gp/product/1430272295/">Magento Book</a> that&#8217;s due out in December, and picking up more freelance work.</p>
<p>I also started to catalog some of my <a href="http://snipt.net/robertbanh">code pieces</a> in snipt.</p>
<p>Yes, it&#8217;s true I have no life&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://htmltree.com/update/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP and SOAP</title>
		<link>http://htmltree.com/php-and-soap/</link>
		<comments>http://htmltree.com/php-and-soap/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 12:46:12 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[soap]]></category>

		<guid isPermaLink="false">http://htmltree.com/?p=81</guid>
		<description><![CDATA[I&#8217;m not a fan of PHP/SOAP but depending on your project, you may need to use a SOAP protocol to access certain API or Webservices.
Being a lazy person, I will post my set of notes and how I build PHP SOAP calls as a reference guide to anyone who may find it useful.
You&#8217;ll notice two [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not a fan of PHP/SOAP but depending on your project, you may need to use a SOAP protocol to access certain API or Webservices.</p>
<p>Being a lazy person, I will post my set of notes and how I build PHP SOAP calls as a reference guide to anyone who may find it useful.</p>
<p>You&#8217;ll notice two important functions that aren&#8217;t discuss widely:<br />
__getFunctions<br />
__getTypes</p>
<p>These are lifesavers because if you don&#8217;t like to read documentations (like myself), then you can run those 2 commands and reverse engineer the available APIs.</p>
<p><span id="more-81"></span></p>
<pre class="brush: php;">
&lt;?

// ========================
// Insert the path to the wsdl file.
// This is an example of Confluence's wsdl file.
// ========================
$client = new SoapClient(
    &quot;http://localhost:8080/rpc/soap-axis/confluenceservice-v1?wsdl&quot;
    ,array(&quot;trace&quot; =&gt; 1, &quot;exceptions&quot; =&gt; 0)
);  

// ========================
// Displays all functions
// ========================
echo &quot;&lt;h2&gt;All Functions&lt;/h2&gt;&quot;;
$functions = $client-&gt;__getFunctions();
print_r($functions);  

// ========================
// Display all Types
// ========================
echo &quot;&lt;h2&gt;All Objects and Types&lt;/h2&gt;&quot;;
$types = $client-&gt;__getTypes();
print_r($types);

// ========================
// Login API call for Confluence.
// ========================
$token = $client-&gt;login(&quot;admin&quot;, &quot;secretPasswd&quot;);
echo &quot;&lt;p&gt;Token: $tok&lt;/p&gt;&quot;;  

// ========================
// Pull all Confluence Spaces.
// ========================
$spaces = $client-&gt;getSpaces($token);
echo &quot;&lt;h2&gt;All Spaces&lt;/h2&gt;&quot;;
print_r($spaces);

?&gt;
</pre>
<p>The above example is great for initial testing. But on production, you&#8217;ll want to wrap the SOAP calls in try/catch statements or just call <a href="http://us3.php.net/manual/en/function.is-soap-fault.php">is_soap_fault</a> method to exit gracefully.</p>
<pre class="brush: php;">

$token = $client-&gt;login(&quot;admin&quot;, &quot;secretPasswd&quot;);
if (is_soap_fault($token)) {
    trigger_error(&quot;SOAP Fault: (faultcode: {$result-&gt;faultcode}, faultstring: {$result-&gt;faultstring})&quot;, E_USER_ERROR);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://htmltree.com/php-and-soap/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SXSW 2009 Notes</title>
		<link>http://htmltree.com/sxsw-2009-notes/</link>
		<comments>http://htmltree.com/sxsw-2009-notes/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 18:00:12 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[garyvee]]></category>

		<category><![CDATA[keynote]]></category>

		<category><![CDATA[notes]]></category>

		<category><![CDATA[sxsw]]></category>

		<category><![CDATA[videos]]></category>

		<category><![CDATA[zappos]]></category>

		<guid isPermaLink="false">http://htmltree.com/?p=69</guid>
		<description><![CDATA[At the conference, there were so many people clicking and clanking away at the keyboards. Insane note takers!
Here&#8217;s a few useful links if you didn&#8217;t attend or needed a recap:
Tony Hsieh (Zappos) Keynote:
Video1, Video2,
Slides, graphic notes

GaryVee Keynote:
Video
Videos:
Design for the Wisdom of Crowds
Everything You Know About Web Design Is Wrong
Is Privacy Dead or Just Very Confused?
Is [...]]]></description>
			<content:encoded><![CDATA[<p>At the conference, there were so many people clicking and clanking away at the keyboards. Insane note takers!</p>
<p>Here&#8217;s a few useful links if you didn&#8217;t attend or needed a recap:</p>
<p>Tony Hsieh (Zappos) Keynote:<br />
<a href="http://www.youtube.com/watch?v=63WFjoFiXns">Video1</a>, <a href="http://www.youtube.com/watch?v=BP6a2SHb0b4">Video2</a>,<br />
<a href="http://www.slideshare.net/zappos/zappos-sxsw-31409">Slides</a>, <a href="http://sxsw.com/files/u5/Tony-Hsieh-at-SXSW-09-Sunni-Brown.jpg">graphic notes</a></p>
<p><span id="more-69"></span><br />
GaryVee Keynote:<br />
<a href="http://garyvaynerchuk.com/post/86998558/gary-vaynerchuks-sxsw-keynote">Video</a></p>
<p>Videos:<br />
<a href="http://www.youtube.com/watch?v=RX-7xwPPY8I&#038;feature=PlayList&#038;p=0ABEEA4DEAFF1E9D&#038;index=9">Design for the Wisdom of Crowds</a><br />
<a href="http://www.youtube.com/watch?v=CIRbQB4O45M&#038;feature=PlayList&#038;p=0ABEEA4DEAFF1E9D&#038;index=10">Everything You Know About Web Design Is Wrong</a><br />
<a href="http://www.youtube.com/watch?v=gZKd0QtcmQg&#038;feature=PlayList&#038;p=0ABEEA4DEAFF1E9D&#038;index=11">Is Privacy Dead or Just Very Confused?</a><br />
<a href="http://www.youtube.com/watch?v=YQu0292dftA&#038;feature=PlayList&#038;p=0ABEEA4DEAFF1E9D&#038;index=12">Is Spec Work Evil? The Online Creative Community</a><br />
<a href="http://www.youtube.com/watch?v=w3fy4Cic5i4&#038;feature=PlayList&#038;p=0ABEEA4DEAFF1E9D&#038;index=13">Strong Gaming Communities: Text vs. Speech</a><br />
<a href="http://www.youtube.com/watch?v=MVzOFPCaihw&#038;feature=PlayList&#038;p=0ABEEA4DEAFF1E9D&#038;index=14">I Love You, Man: Are You Man Enough to Say</a><br />
<a href="http://www.youtube.com/watch?v=bXYXUwyt2Bc&#038;feature=PlayList&#038;p=0ABEEA4DEAFF1E9D&#038;index=15">Web Awards Opening</a><br />
<a href="http://www.youtube.com/watch?v=xLynvDmyY1g&#038;feature=PlayList&#038;p=0ABEEA4DEAFF1E9D&#038;index=19">Finance 2.0</a><br />
<a href="http://www.youtube.com/watch?v=WCLGnMdBeW8&#038;feature=PlayList&#038;p=0ABEEA4DEAFF1E9D&#038;index=20">Journey to the Center of Design Pt. 1</a>, <a href="http://www.youtube.com/watch?v=Zpy7PKIhXgU&#038;feature=PlayList&#038;p=0ABEEA4DEAFF1E9D&#038;index=21">Pt. 2</a><br />
<a href="http://www.youtube.com/watch?v=LiKokGMzHPY&#038;feature=PlayList&#038;p=0ABEEA4DEAFF1E9D&#038;index=22">Tangible Interactions in Urban Spaces  </a><br />
<a href="http://www.youtube.com/watch?v=6csJaS6XMg8&#038;feature=PlayList&#038;p=0ABEEA4DEAFF1E9D&#038;index=25">Vivid Entertainment: The Sex-Driven Market </a> </p>
<p>Download a set of notes:<br />
<a href="http://github.com/cmheisel/sxsw09-notes-heisel/downloads">http://github.com/cmheisel/sxsw09-notes-heisel/downloads</a></p>
<p>Sketchnotes:<br />
<a href="http://www.rohdesign.com/weblog/archives/003039.html">Mike Rohde</a></p>
<p>SXSW notes from the internet:<br />
<a href="http://techory.com/sxsw/">http://techory.com/sxsw/</a><br />
<a href="http://danielslaughter.com/category/geeky/sxsw-2009/">http://danielslaughter.com/category/geeky/sxsw-2009/</a><br />
<a href="http://almostdaniel.com/categories/sxsw/">http://almostdaniel.com/categories/sxsw/</a><br />
<a href="http://www.davepoortvliet.com/category/sxsw/">http://www.davepoortvliet.com/category/sxsw/</a><br />
<a href="http://regnskygge.net/sxsw2009/">http://regnskygge.net/sxsw2009/</a></p>
<p>More slides:<br />
<a href="http://www.slideshare.net/charleneli/sxsw09-the-future-of-social-networks">http://www.slideshare.net/charleneli/sxsw09-the-future-of-social-networks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://htmltree.com/sxsw-2009-notes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Stupid Wordpress Hack</title>
		<link>http://htmltree.com/stupid-wordpress-hack/</link>
		<comments>http://htmltree.com/stupid-wordpress-hack/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 13:36:45 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[hack]]></category>

		<category><![CDATA[login]]></category>

		<category><![CDATA[passwd]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://htmltree.com/?p=59</guid>
		<description><![CDATA[So you have lost your admin password? Well then let&#8217;s just hack the system.

Step 1: Open up your /wp-includes/pluggable.php
Step 2: Go to the function wp_authenticate (line 438)
Step 3: Add this to line 439: return WP_User(1);
So the code should look like this:

function wp_authenticate($username, $password) {
	return WP_User(1);

Step 4: Go to your login page and input any username/passwd. [...]]]></description>
			<content:encoded><![CDATA[<p>So you have lost your admin password? Well then let&#8217;s just hack the system.</p>
<p><span id="more-59"></span><br />
<strong>Step 1</strong>: Open up your <code>/wp-includes/pluggable.php</code></p>
<p><strong>Step 2</strong>: Go to the <code>function wp_authenticate</code> (line 438)</p>
<p><strong>Step 3</strong>: Add this to line 439: <code>return WP_User(1);</code></p>
<p>So the code should look like this:</p>
<pre class="brush: php;">
function wp_authenticate($username, $password) {
	return WP_User(1);
</pre>
<p><strong>Step 4</strong>: Go to your login page and input any username/passwd. Make sure you have checked the &#8220;Remember Me&#8221; checkbox.</p>
<p><strong>Step 5</strong>: Once you&#8217;re logged on, remove that line from Step 3.</p>
<p>Now you&#8217;re back in business.</p>
<p>I do not recommend this because your system is left wide open for any user to log on, but if you&#8217;re a little pee-on like me, and nobody cares to hack your system then do it <img src='http://htmltree.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://htmltree.com/stupid-wordpress-hack/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CSS Columns with Position Absolute/Relative</title>
		<link>http://htmltree.com/css-columns-with-position-absoluterelative/</link>
		<comments>http://htmltree.com/css-columns-with-position-absoluterelative/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 01:01:05 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[absolute]]></category>

		<category><![CDATA[columns]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[position]]></category>

		<category><![CDATA[relative]]></category>

		<category><![CDATA[toc]]></category>

		<guid isPermaLink="false">http://htmltree.com/?p=15</guid>
		<description><![CDATA[One of the problems I face with CSS is creating a 2 tier column but having the left column left align, and the right column right align.
I&#8217;m a fan of floating all my elements. So I rarely use position absolute. 

Then I saw an article on creating a table of content in CSS. Wow, that&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>One of the problems I face with CSS is creating a 2 tier column but having the left column left align, and the right column right align.</p>
<p>I&#8217;m a fan of floating all my elements. So I rarely use position absolute. </p>
<p><span id="more-15"></span><br />
Then I saw an article on <a href="http://www.webdesignerwall.com/tutorials/css-menu-list-design/">creating a table of content in CSS</a>. Wow, that&#8217;s my solution!</p>
<p>So here&#8217;s my approach&#8230;</p>
<p>CSS</p>
<pre class="brush: html;">
&lt;style type=&quot;text/css&quot;&gt;
  .container           {position:relative; width:960px; }
  .container div.left  {position:absolute; left:0;}
  .container div.right {position:absolute; right:0;}
&lt;/style&gt;
</pre>
<p>HTML</p>
<pre class="brush: html;">
&lt;div class='container'&gt;
  &lt;div class='left'&gt;This should be left align.&lt;/div&gt;
  &lt;div class='right'&gt;And right align.&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>And here&#8217;s the results:</p>
<style type="text/css">
  .container           {position:relative; width:450px; height:40px; border:1px solid green;}
  .container div.left  {position:absolute; left:0; color:red; font-weight:bold;}
  .container div.right {position:absolute; right:0; color:blue; font-weight:bold;}
</style>
<div class='container'>
<div class='left'>This should be left align.</div>
<div class='right'>And right align.</div>
</div>
<p><br/></p>
<p>Since the outer container is <code>position:relative</code>, it will fit nicely anywhere on the page. And the inner divs are <code>position:absolute</code>, which pushes it toward the edge.</p>
<p>These articles are a way for me to store my own tricks and hacks so I can always reference back to it on future projects. But I like to share. Hope it was helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://htmltree.com/css-columns-with-position-absoluterelative/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Free PSD Downloads</title>
		<link>http://htmltree.com/free-psd-downloads/</link>
		<comments>http://htmltree.com/free-psd-downloads/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 05:58:15 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[downloads]]></category>

		<category><![CDATA[free]]></category>

		<category><![CDATA[goodies]]></category>

		<category><![CDATA[photoshop]]></category>

		<category><![CDATA[psd]]></category>

		<guid isPermaLink="false">http://htmltree.com/?p=9</guid>
		<description><![CDATA[All works are licensed under the Creative Commons Attribution 3.0 license.
I believe in giving back to the community. And one way of accomplishing that is to give you all my old PSD design files. I always enjoyed viewing PSD files from other designers. It gives you a glimpse into their design process and how each [...]]]></description>
			<content:encoded><![CDATA[<p>All works are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.</p>
<p>I believe in giving back to the community. And one way of accomplishing that is to give you all my old PSD design files. I always enjoyed viewing PSD files from other designers. It gives you a glimpse into their design process and how each layer worked into creating a wonderful masterpiece.</p>
<p><span id="more-9"></span></p>
<p>Once you unzip the files, they will all be in PSD format. So make sure you have Adobe Photoshop installed on your system. Feel free to modify, change, mutate any of my files. </p>
<p>If they were helpful, please send me an email. Enjoy!</p>
<h3>
<p>					Personal Work Designed on 10/2007</p>
</h3>
<p>				<img src="/images/skills.jpg" alt="skills"/></p>
<p><a href="/images/psd/skills.zip">skills.zip</a> (1.8 mb)</p>
<h3>
<p>					Personal Work Designed on 09/2007</p>
</h3>
<p>				<img src="/images/peterpan_flying.jpg" alt="peterpan flying"/></p>
<p><a href="/images/psd/peterpan_flying.zip">peterpan_flying.zip</a> (856 kb)</p>
<h3>
<p>					Personal Work Designed on 12/2006</p>
</h3>
<p>				<img src="/images/break.jpg" alt="break"/></p>
<p><a href="/images/psd/break.zip">break.zip</a> (2.5 mb)</p>
<h3>
<p>					Personal Work Designed on 01/2006</p>
</h3>
<p>				<img src="/images/wiener.jpg" alt="wiener"/></p>
<p><a href="/images/psd/wiener.zip">wiener.zip</a> (13.7 mb)</p>
<h3>
<p>					Personal Site Designed on 08/2004</p>
</h3>
<p>				<img src="/images/layout2.jpg" alt="layout2"/></p>
<p><a href="/images/psd/layout2.zip">layout2.zip</a> (812 kb)</p>
<h3>
<p>					Personal Work Designed on 10/2003</p>
</h3>
<p>				<img src="/images/path1.jpg" alt="path1"/></p>
<p><a href="/images/psd/path1.zip">path1.zip</a> (1.4 mb)</p>
]]></content:encoded>
			<wfw:commentRss>http://htmltree.com/free-psd-downloads/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Firefox Only Print One Page Bug</title>
		<link>http://htmltree.com/firefox-only-print-one-page-bug/</link>
		<comments>http://htmltree.com/firefox-only-print-one-page-bug/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 05:03:37 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[firefox]]></category>

		<category><![CDATA[print]]></category>

		<guid isPermaLink="false">http://htmltree.com/?p=6</guid>
		<description><![CDATA[As a web developer, you will come across various problems related to your web site. A few weeks ago, I was told that my web page only printed one page. Strange, the screen displays a large table set that expands ~4 pages.

And the kicker, it does this on Firefox. Wow.
After a few minutes of googling, [...]]]></description>
			<content:encoded><![CDATA[<p>As a web developer, you will come across various problems related to your web site. A few weeks ago, I was told that my web page only printed one page. Strange, the screen displays a large table set that expands ~4 pages.</p>
<p><span id="more-6"></span><br />
And the kicker, it does this on Firefox. Wow.</p>
<p>After a few minutes of googling, I have discovered the culprit to be within CSS.</p>
<p>Here was my simple solution.</p>
<h3><a name="print">Print.css</a></h3>
<p>Create a new style sheet made for print. It&#8217;s best to include this right below all your other style sheets, so it can overwrite any elements right before the user prints.</p>
<pre class="brush: html;">
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;all&quot; href=&quot;style.css&quot; /&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;print&quot; href=&quot;print.css&quot; /&gt;
</pre>
<p>Ok Batman, let&#8217;s override some code.</p>
<h3><a name="overflow">Overflow</a></h3>
<p>My tables had a class to set the fonts and cell size. So you just need to set the overflow.</p>
<pre class="brush: css;">
table, .tableClass, #tableID {
    overflow: visible !important;
}
</pre>
<h3><a name="float">Float</a></h3>
<p>I also had a Nav menu that was set to float left. This needed to be print friendly.</p>
<pre class="brush: css;">.nav {
    float: none !important;
}
</pre>
<h3><a name="position">Position</a></h3>
<p>And lastly, my logo was an absolute position. Override that with the following.</p>
<pre class="brush: css;">
#logo img {
    position: relative;
}
</pre>
<p>Those 9 lines of code should fix the problem.</p>
<p><strong>HTMLTree&#8217;s comment</strong>: <a href="http://www.alistapart.com/stories/goingtoprint/">Eric Meyer</a> also recommends setting your background-color to white. But most printers will omit any background color during printing. It&#8217;s up to you.</p>
<pre>
body {
    background: white;

or

    background: transparent;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://htmltree.com/firefox-only-print-one-page-bug/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Beauty of jQuery</title>
		<link>http://htmltree.com/the-beauty-of-jquery/</link>
		<comments>http://htmltree.com/the-beauty-of-jquery/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 05:01:06 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[ajax]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://htmltree.com/?p=3</guid>
		<description><![CDATA[I&#8217;ll admit, I resisted the use of frameworks. I believe in understanding the core structure and building from it. But after 2 years of working with heavy Javascript, I decided it was time to test out some frameworks to speed up my work.

There&#8217;s about 100+ Javascript frameworks out there. Picking one was no easy task. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll admit, I resisted the use of frameworks. I believe in understanding the core structure and building from it. But after 2 years of working with heavy Javascript, I decided it was time to test out some frameworks to speed up my work.</p>
<p><span id="more-3"></span><br />
There&#8217;s about 100+ Javascript frameworks out there. Picking one was no easy task. I took about 2 weeks to test out a handful of frameworks and ended up choosing <a href="http://jquery.com/">jquery</a>.</p>
<p>It&#8217;s tiny. no overhead. It also has a well supported community. Which means plugins galore. And it based off of CSS syntax. So there&#8217;s very little learning curve.</p>
<p>And the best feature of all&#8230; it&#8217;s cross browser compliant!!</p>
<p>No more MSIE hacks or special code for Opera. Your complex Javascript will work on all browsers. That&#8217;s a saving of 2 weeks worth of programming already!</p>
<p>With <a href="http://mootools.net/">MooTools</a> and <a href="http://www.prototypejs.org/">Prototype</a>, you have to be careful not to use the same variable name as their API. But not with jQuery. It is completely isolated in it&#8217;s scope and won&#8217;t affect any global namespace.</p>
<p><a href="http://developer.yahoo.com/yui/">Yahoo UI</a> and <a href="http://dojotoolkit.org/">Dojo</a>, well those are big boys. And i mean HUGE files. I prefer small footprint over bulky features. In fact, I&#8217;ll stab my eye out before I use Dojo&#8230; but I&#8217;ll digress.</p>
<p>Ok, enough chit-chat, lets get down to business.</p>
<h3><a name="init">Init</a></h3>
<pre class="brush: js;">
$(document).ready(function(){
  // init method
});
</pre>
<p>The init. When the HTML page is loaded, and all the DOM is rendered, JQuery will kick into action with the init function. It&#8217;s similar to the onload method in javascript, but smarter.</p>
<p>The secret of the init, just like any other language, is how you use it. This can be a powerful technique given the correct discipline.</p>
<p>Here is <strong>HTMLTree&#8217;s recommendation</strong>:</p>
<h3>Events</h3>
<p>Set your events. You can save tons of code, which equals savings in bandwidth and download time, if you remove all those onclick and onmouseover attributes in your tags. Set them in one place; the init. It&#8217;ll save time when you have to update or modify your events. Go to one place, update the code, and charge your clients .25 hours of work.</p>
<pre class="brush: js;">
$(document).ready(function(){
  // init method

  // add onblur to &lt;input type='text' id='zipCode' /&gt;
  $(&quot;input[type='text'][id='zipCode']&quot;).blur( function () {
  	getState($this.val());
  });
});
</pre>
<p>In the example above, the HTML will render to this:<br />
<code> &lt;input type='text' id='zipCode' onblur='getState(this.value)' /&gt;</code></p>
<h3>CSS</h3>
<p>Set your style. There&#8217;s been so much talk on presentation layer verses model crap. Well here&#8217;s a nice way to satisfy both the developer and designer. Set all your CSS in the init. You can get pretty advance with this technique given JQuery&#8217;s engine.</p>
<pre class="brush: js;">
$(document).ready(function(){
  // init method

  // set all anchor tags to CSS cursor='pointer'
  $(&quot;a&quot;).css(&quot;cursor&quot;, &quot;pointer&quot;);
  // set all anchor tags that start with 'marketing' to CSS color='#CCC'
  $(&quot;a[href^='marketing']&quot;).css(&quot;color&quot;, &quot;#CCC&quot;);
});
</pre>
<p>Sure you can set all of this in your style sheet. But sometimes you just need to set it for one page. Or you need to overwrite a CSS depending on a Javascript event. It gets very useful once you start adding Ajax calls and returning a nice green <span style="color: green;">complete</span> status message to your end user. We&#8217;ll drill into that trick further down this tutorial.</p>
<p>Hopefully by now you have a little understanding on how to access the DOM through jQuery.</p>
<p>Let&#8217;s learn by example&#8230;</p>
<h3><a name="examples">jQuery by Examples</a></h3>
<pre class="brush: js;">
// &lt;textarea name='foo'&gt;
$(&quot;textarea&quot;).attr(&quot;name&quot;, &quot;foo&quot;);

// &lt;div style='color: blue;'&gt;
$(&quot;div&quot;).css(&quot;color&quot;, &quot;blue&quot;);

// &lt;div class='apple' style='display: none;'&gt;
$(&quot;.apple&quot;).hide();

// &lt;div id='pear'&gt;
$(&quot;#pear&quot;).show();

// &lt;table id='data'&gt;
//  &lt;tr&gt;
//    &lt;td style='text-align: center;'&gt;
$(&quot;table[id='data']&quot;).find(&quot;tr&quot;).children().css(&quot;text-align&quot;, &quot;center&quot;);

// self explanatory?
function removeLastRow( tableID ) {
	$(&quot;#tableID&quot;).find(&quot;tr:last&quot;).remove();
}
</pre>
<p><strong>HTMLTree&#8217;s tip</strong>: When I first worked with jQuery, I kept trying to use <strong>$(&#8221;tableID&#8221;)</strong> to call a table tag with id=&#8217;tableID&#8217;. After a few minutes of frustration, it finally occurred to me that since the attribute is an ID, I had to use the &#8220;pound&#8221; symbol. So the correct reference is <strong>$(&#8221;#tableID&#8221;)</strong>. Keep that in mind when you&#8217;re writing your first jQuery code.</p>
<h3><a name="ajax">AJAX</a></h3>
<p>Ahh, here we are. This is the goood part <img src='http://htmltree.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre class="brush: js;">
$(document).ready(function(){
  // init methods

  // hide loading gif
  $(&quot;img[id='loading']&quot;).hide();

  // if a button is pushed
  $(&quot;input[type='button']&quot;).click(function(){

    // display loading gif
    $(&quot;img[id='loading']&quot;).show();

    // send an ajax command
    $.ajax({
       type:     &quot;POST&quot;,
       url:      &quot;doSomething.php&quot;,
       data:     &quot;sessionID=1234&amp;username=Rick&quot;,
       dataType: &quot;html&quot;,
       success: function( html_from_doSomething_php ){
         // if successful...
         $(&quot;img[id='loading']&quot;).hide();
         alert( html_from_doSomething_php );
       },
       error: function( html_from_doSomething_php ){
         // if error...
         $(&quot;img[id='loading']&quot;).hide();
         alert( &quot;error occurred&quot; );
       }
    }); // end of ajax

  }); // end of onclick

}); // end of init
</pre>
<p>This is my basic Ajax call. I always display a loading gif when an Ajax command is being executed. But the choice is up to you.</p>
<p><strong>HTMLTree&#8217;s tip</strong>: If you need a synchronous Ajax call, instead of async, I recommend using the <a href="http://www.malsup.com/jquery/block/">blockUI plugin</a>. This amazing plugin will hold up the user&#8217;s screen until the Ajax command is completed. In technical term, it&#8217;s a modal box. </p>
<h3><a name="extra">Extra Stuff</a></h3>
<p>I recommend checking out some of these jQuery demos/plugins:</p>
<ul>
<li><a href="http://www.noupe.com/jquery/50-amazing-jquery-examples-part1.html">50 Amazing jQuery Examples (Part 1)</a></li>
<li><a href="http://plugins.jquery.com/project/jCache">jCache - A Client Side Cache Plugin</a></li>
<li><a href="http://plugins.jquery.com/project/jqSOAPClient">jQuery SOAP Client</a></li>
<li><a href="http://plugins.jquery.com/project/SuperFlyDOM">SuperFlyDOM</a></li>
<li><a href="http://www.malsup.com/jquery/block/">BlockUI Plugin</a></li>
<li><a href="http://plugins.jquery.com/project/ajaxqueue">Ajax Queue</a></li>
<li><a href="http://plugins.jquery.com/project/datepicker">DatePicker - Calendar Plugin</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://htmltree.com/the-beauty-of-jquery/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
