<?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>Pengbo&#039;s</title>
	<atom:link href="http://pengbos.com/feed" rel="self" type="application/rss+xml" />
	<link>http://pengbos.com</link>
	<description>Pengbo&#039;s Home Page</description>
	<lastBuildDate>Wed, 04 Jan 2012 03:22:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Redbusiness Theme Installation Manual</title>
		<link>http://pengbos.com/blog/redbusiness-theme-installation-manual</link>
		<comments>http://pengbos.com/blog/redbusiness-theme-installation-manual#comments</comments>
		<pubDate>Thu, 29 Dec 2011 06:56:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[manual]]></category>

		<guid isPermaLink="false">http://pengbos.com/?p=817</guid>
		<description><![CDATA[Thank you for choosing my theme. If you have any questions that are beyond the scope of this manual, please feel free to comment or to email via my contact form. A) Getting Started In order to begin installing Redbusiness theme. You need the WordPress version above 3.0, the latest one is better. Here is [...]]]></description>
			<content:encoded><![CDATA[<p>Thank you for choosing my theme. If you have any questions that are beyond the scope of this manual, please feel free to comment or to email via my contact form.</p>
<h3>A) Getting Started</h3>
<p>In order to begin installing Redbusiness theme. You need the WordPress version above 3.0, the latest one is better. Here is <a href="http://wordpress.org">the download URL</a>. Once you downloaded and set it up, You are ready to go.</p>
<p><strong>Installation</strong><br />
Upon downloading the zip file, you will unzip the file. Upload this folder to your themes folder at: your WordPress installation root directory /wp-content/themes</p>
<p>Log into WordPress administration and click on the Appearance >> Themes tab. After that is done, activate the theme as you would activate any other theme. </p>
<hr />
<h3>B) Home Page options</h3>
<p><span id="more-817"></span><br />
The home page is designed as a custom post type. As you may see there is a new post type: &#8220;Home Page&#8221; in the left side navigation besides the ordinary wordpress types. Add a new element for the home page by clicking &#8220;Add New&#8221;, and select &#8220;Introduction&#8221; or &#8220;bits&#8221; section for your need. </p>
<h5>1. Welcome Section</h5>
<p>See the screenshot for introduction section. this section is designed to let you have a brief introduction on the corporation or the website.</p>
<p><a href="http://pengbos.com/wp-content/uploads/2011/03/step1.jpg"><img src="http://pengbos.com/wp-content/uploads/2011/03/step1.jpg" alt="" title="step1" width="610" height="426" class="aligncenter size-full wp-image-608" /></a> </p>
<h5>2. Bits Section</h5>
<p>And add a new element for bits section on the home page, which displayed under the introduction section. It is better to add three bits, as it is a three column layout. Please note, you can add photos in the &#8220;image for posts&#8221; custom fields. and it thumb nails are generated automatically in the home page. so don&#8217;t worry about the size.</p>
<p><a href="http://pengbos.com/wp-content/uploads/2011/03/step2.jpg"><img src="http://pengbos.com/wp-content/uploads/2011/03/step2.jpg" alt="" title="step2" width="610" height="427" class="aligncenter size-full wp-image-611" /></a></p>
<hr />
<h3>C) Gallery Page setup</h3>
<p>The Gallery page is designed as a custom post type. As you may see there is a new post type: &#8220;Portfolio&#8221; in the left side navigation bellow the &#8220;Home Page&#8221; type. Add a new element for the portfolio by clicking &#8220;Add New&#8221;.  </p>
<p><a href="http://pengbos.com/wp-content/uploads/2011/12/gallery.png"><img src="http://pengbos.com/wp-content/uploads/2011/12/gallery.png" alt="" title="gallery" width="660"  class="aligncenter size-full wp-image-821" /></a></p>
<p>Input every necessary fields.</p>
<hr />
<h3>D) Other Pages</h3>
<p>Two Pages are predefined: About and Services.The menus About us and Services link to the two pages.</p>
<p><a href="http://pengbos.com/wp-content/uploads/2011/12/pages.png"><img src="http://pengbos.com/wp-content/uploads/2011/12/pages.png" alt="" title="pages" width="660" class="aligncenter size-full wp-image-825" /></a></p>
<p>please note, name the pages exactly the same with the figure shows.</p>
<hr />
<h3>E) Widget</h3>
<p>Redbusiness has 3 ready made widgets.</p>
<p>   1. The first one is &#8220;Right Sidebar&#8221; will show on every page (with right sidebar page style)<br />
   2. The second one is &#8220;Contact Sidebar&#8221; will show on contact page.<br />
   3. The third one is &#8220;Service Sidebar&#8221; will show on service page.</p>
<p>To add content to sidebar simple go to <strong>Appearance > Widgets</strong> and drag item into certain sidebar. </p>
<h2>Finally</h2>
<p>Click preview to check out your website. How do you like it? <img src='http://pengbos.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Here is a screencast for installation guide. In case the manual does not cover everything.</p>
<p><iframe src="http://www.screenr.com/embed/nBos" width="650" height="396" frameborder="0"></iframe></p>
<p>Are these steps too complicated? Fine, there are three other simpler but expensive ways:</p>
<h5>1. Import everything from my demo site</h5>
<p>wordpress support export and import from another wordpress functionality. So you can get a copy of my demo site data file and import to your site. Everything is there, and you just need to do some customization.  However it is not free, it will cost you 1$.</p>
<h5>2. Import everything from my demo site from sql</h5>
<p>As everything is stored in the mysql database, you can grab an exported sql database from me. and replace the url to yours and import to your database. And you also need to do some customization.  it will cost you 1$ too.</p>
<h5>3. Ask me for help. I will setup the site for you</h5>
<p>Ok, this is the easiest way. You just send me an email, and then everything is ready. Ok, but it will cost you 20$.</p>
<p>Any way, I hope you can take care all of it by yourself. Of course, i am also glad to help.</p>
]]></content:encoded>
			<wfw:commentRss>http://pengbos.com/blog/redbusiness-theme-installation-manual/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Christmas and New Year Special Deals</title>
		<link>http://pengbos.com/blog/christmas-and-new-year-special-deal</link>
		<comments>http://pengbos.com/blog/christmas-and-new-year-special-deal#comments</comments>
		<pubDate>Sat, 24 Dec 2011 01:04:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[christmas]]></category>
		<category><![CDATA[deal]]></category>
		<category><![CDATA[special]]></category>

		<guid isPermaLink="false">http://pengbos.com/?p=802</guid>
		<description><![CDATA[Christmas is on the corner, and new year is approaching. Thanks my dear friends for your support during the past year! Pengbos.com would like to present you special deals on my theme and service. From Dec 24th 2011 to Jan 2ed 2012 &#8211; wordpress theme with regular license (no credit links)Red Business for $ 5 [...]]]></description>
			<content:encoded><![CDATA[<p>Christmas is on the corner, and new year is approaching. Thanks my dear friends for your support during the past year! Pengbos.com would like to present you special deals on my theme and service.<br />
<strong><br />
From Dec 24th 2011 to Jan 2ed 2012</strong> &#8211; wordpress theme with regular license (no credit links)<strong><a href="https://pengbosshop.appspot.com/" target="_blank">Red Business</a></strong> for $ <strong>5</strong>  instead of $ 17. Buy it from the shop: <a href="https://pengbosshop.appspot.com/" target="_blank">pengbosShop</a></p>
<p><strong><br />
From Dec 24th 2011 to Jan 2ed 2012</strong>  &#8211; sell on us for <strong>free</strong> instead of 10% fee. You can sell your digital goods (downloadable) on  <a href="https://pengbosshop.appspot.com/" target="_blank">pengbosShop</a> without payment.  Submit your digital goods details to me through the contact form.  Once it is confirmed by Admin, your good will appear on the PengbosShop.</p>
<p>I sincerely hope that you find our offer valuable goods and services to you, and perhaps you can use the theme to build a website for your client. Please keep in mind that this special deal is valid only for 10 days and then will be offered at the normal price.</p>
<p>[updated on Jan 3rd]<br />
The offer is ended, and the template and services are back to normal prices. Thanks for your attention.</p>
]]></content:encoded>
			<wfw:commentRss>http://pengbos.com/blog/christmas-and-new-year-special-deal/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Premium Single Page Portfolio WordPress Theme: Red Business</title>
		<link>http://pengbos.com/blog/red-business</link>
		<comments>http://pengbos.com/blog/red-business#comments</comments>
		<pubDate>Sat, 17 Dec 2011 09:57:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[premium]]></category>
		<category><![CDATA[single page]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://pengbos.com/?p=777</guid>
		<description><![CDATA[Red Business is a free wordpress theme. It is designed as a single page portfolio theme. Red is the most favorite color in China, and it means prosperous, wealthy and passionate. people who run their own company, always wish their business prosperous. so in china, people wish their business in red. The features of this [...]]]></description>
			<content:encoded><![CDATA[<p>Red Business is a free wordpress theme. It is designed as a single page portfolio theme. Red is the most favorite color in China, and it means prosperous, wealthy and passionate. people who run their own company, always wish their business prosperous. so in china, people wish their business in red.<br />
The features of this theme:<br />
    * Single Page<br />
    * grids based layout<br />
    * elegant coda slider.<br />
    * fancyzoom enabled portfolio<br />
    * SEO friendly<br />
    * Customized Custom Field Ready<br />
    * Customizable sidebar, flexible. <span id="more-777"></span><br />
    * Custom post type for home page and portfolio<br />
    * Ready to use Contact form<br />
    * Cross Browser Compatible<br />
    * WordPress above 3.0 compatible<br />
    * Simple and Poweful Admin Theme Options</p>
<p><a rel="license" href="http://creativecommons.org/licenses/by/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/80x15.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>.</p>
<p>If you want to get a regular license for commercial usage, and don&#8217;t want the credit links at the footer, please buy a license from <a href="https://pengbosshop.appspot.com ">pengbosShop</a></p>
<p>download link:<br />
<h2><a href="http://pengbos.com/?download=redbusiness_v0.1">redbusiness_v0.1</a> </h2>
<p> <strong> (Size  217.1 kB)</strong></p>
<p>the installation guide: <a href="http://pengbos.com/blog/redbusiness-theme-installation-manual">http://pengbos.com/blog/redbusiness-theme-installation-manual</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pengbos.com/blog/red-business/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Corporattica Theme: Version 0.2</title>
		<link>http://pengbos.com/blog/corporattica-theme-version-0-2</link>
		<comments>http://pengbos.com/blog/corporattica-theme-version-0-2#comments</comments>
		<pubDate>Tue, 20 Sep 2011 14:48:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[corporattica]]></category>
		<category><![CDATA[v0.2]]></category>
		<category><![CDATA[wp_head]]></category>

		<guid isPermaLink="false">http://pengbos.com/?p=765</guid>
		<description><![CDATA[First of all, thank you all like this theme. And I also received a lot emails complaining that this theme is not so friendly to wordpress plugins. There are thousands of plugins in the wordpress community, and most of them are very helpful to the wordpress users. So a rule of thumb for a good [...]]]></description>
			<content:encoded><![CDATA[<p>First of all, thank you all like this theme. And I also received a lot emails complaining that this theme is not so friendly to wordpress plugins. There are thousands of plugins in the wordpress community, and most of them are very helpful to the wordpress users. So a rule of thumb for a good wordpress theme should be plugin friendly besides the design (of course, design is also the major rule to choose a theme).</p>
<p>In the new version, i fixed this significant issue by including the wp_head() call in the header.php. Besides this, the issues mentioned in the prior blogs like<br />
1. security issue in timthumb script<br />
2. sending email issues<br />
are all fixed in this new version (actually the v0.1 also includes these fixing)<br />
<span id="more-765"></span></p>
<p>The download url is</p>
<p><a href="http://pengbos.com/?download=corporattica-v0.2"><strong>corporattica v0.2</strong></a><strong> (Size  543.5 kB)</strong></p>
<p>This release is more like a bug fix release, there is no design changes. So please refer to the old version for features and credits and <strong><a href="http://pengbos.com/blog/corporattica-theme-installation-guide">installation guide</a></strong>.</p>
<p>V0.1 <a href="http://pengbos.com/blog/a-new-free-premium-wordpress-theme-corporattica-is-ready">http://pengbos.com/blog/a-new-free-premium-wordpress-theme-corporattica-is-ready</a></p>
<p>Installation Guide: <a href="http://pengbos.com/blog/corporattica-theme-installation-guide">http://pengbos.com/blog/corporattica-theme-installation-guide</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pengbos.com/blog/corporattica-theme-version-0-2/feed</wfw:commentRss>
		<slash:comments>66</slash:comments>
		</item>
		<item>
		<title>Lotus in West Lake</title>
		<link>http://pengbos.com/portfolio/lotus-in-west-lake</link>
		<comments>http://pengbos.com/portfolio/lotus-in-west-lake#comments</comments>
		<pubDate>Mon, 12 Sep 2011 03:05:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[lotus]]></category>

		<guid isPermaLink="false">http://pengbos.com/?p=755</guid>
		<description><![CDATA[Time flies, summer is almost gone. In summer hundreds of lotus blossoms bloom in West Lake. I took some pictures to commemorate this summer. Feel free to download them for free.]]></description>
			<content:encoded><![CDATA[<p>Time flies, summer is almost gone. In summer hundreds of lotus blossoms bloom in West Lake.  I took some pictures to commemorate this summer. Feel free to download them for free.</p>
]]></content:encoded>
			<wfw:commentRss>http://pengbos.com/portfolio/lotus-in-west-lake/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>URGENT: Security Vulnerability in Timthumb</title>
		<link>http://pengbos.com/blog/urgent-security-vulnerability-in-timthumb</link>
		<comments>http://pengbos.com/blog/urgent-security-vulnerability-in-timthumb#comments</comments>
		<pubDate>Tue, 06 Sep 2011 13:49:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[timthumb]]></category>

		<guid isPermaLink="false">http://pengbos.com/?p=746</guid>
		<description><![CDATA[Recently, I was made aware of a security vulnerability within the Timthumb image resizing php script, which is utilized in pengbos.com wordpress themes for dynamic image resizing, including the most favorate Aurelius and Corporattica. It is also widely used in other WordPress themes and plugins. This security vunlnerability may lead to hacker&#8217;s attack to the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I was made aware of a security vulnerability within the Timthumb image resizing php script, which is utilized in pengbos.com wordpress themes for dynamic image resizing, including the most favorate Aurelius and Corporattica. It is also widely used in other WordPress themes and plugins.</p>
<p>This security vunlnerability may lead to hacker&#8217;s attack to the wordpress site. So it is very urgent to fix this issue.</p>
<p>The good news is the author of TimThumb and the author of WordThumb have worked together to release <a href="http://timthumb.googlecode.com/svn/trunk/timthumb.php">TimThumb v2</a> which fixes these security issues.</p>
<p>Now all wordpress themes from Pengbos.com are patched with the latest TimThumb v2, you can download any of them, and reinstall theme to fix this issue.</p>
<p>You can also replace the timthumb manually by yourself like described below. </p>
<p>1.  download the latest timthub script from http://timthumb.googlecode.com/svn/trunk/timthumb.php</p>
<p>2. replace the timthumb.php in the scripts folder in the theme location with the latest version.</p>
<p>That&#8217;s it.</p>
<p>Please upgrade the timthumb as soon as possible!!</p>
<p>If you have any more questions, please don&#8217;t hesitate to send me an email, i will try my best to help.</p>
]]></content:encoded>
			<wfw:commentRss>http://pengbos.com/blog/urgent-security-vulnerability-in-timthumb/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Corporattica Theme: How to Enable Lightbox in Post</title>
		<link>http://pengbos.com/blog/corporattica-theme-how-to-enable-lightbox-in-post</link>
		<comments>http://pengbos.com/blog/corporattica-theme-how-to-enable-lightbox-in-post#comments</comments>
		<pubDate>Sat, 06 Aug 2011 00:59:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[corporattica]]></category>
		<category><![CDATA[fancyzoom]]></category>
		<category><![CDATA[lightbox]]></category>
		<category><![CDATA[post]]></category>

		<guid isPermaLink="false">http://pengbos.com/?p=736</guid>
		<description><![CDATA[Corporattica theme has already embodied with Lightbox feature by Fancyzoom. For example, images in the bit sections in the home page and portfolio page. But, how to enable the lightbox feature in your own post too? Here is the demo http://demo.pengbos.com/corporattica/?p=13 First, let&#8217;s look at the javascript, which enables the fancyZoom, in the header.php $&#40;document&#41;.ready&#40;function&#40;&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>Corporattica theme has already embodied with Lightbox feature by Fancyzoom. For example, images in the bit sections in the home page and portfolio page.</p>
<p>But, how to enable the lightbox feature in your own post too? Here is the demo <a href="http://demo.pengbos.com/corporattica/?p=13" target="_blank"> http://demo.pengbos.com/corporattica/?p=13</a></p>
<p>First, let&#8217;s look at the javascript, which enables the fancyZoom,  in the header.php</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">		$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.photo a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fancyZoom</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span></pre></div></div>

<p>This will add the Zoom Effect to any <strong>a</strong> tag in the <strong>div</strong> tag classed with <em>photo</em>, and will show content relating to the id referenced in the <em>href</em> of the <strong>a</strong> tag.<br />
<span id="more-736"></span><br />
As, the javascript has already been there in the  header.php, you have to write html in your post follow the pattern as described above.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;photo&quot;&gt;    
       &lt;a href=&quot;#yourcontentid&quot;&gt;
           &lt;!--please add you img tag or text content here --&gt;
       &lt;/a&gt;
&lt;/div&gt;    
&lt;div id=&quot;yourcontentid&quot;&gt;
            &lt;!--please add you img tag or text content here --&gt;
&lt;/div&gt;</pre></div></div>

<p>This is an html template that follows the javascript for enabling fancyzoom in your post. For a template, you can not change some predefined tags, but you can add your own content.<br />
Here are the rules that used by the javascript to enable the fancyzoom, so you should not change:<br />
1. the structure of the html cannot be changed.<br />
2. the class name &#8220;photo&#8221; for the first div tag cannot be changed.</p>
<p>But, you can change：<br />
1. you can change the href value, but it must be consistent to the id of the second div.<br />
2. add your content to the a tag, and div tag.</p>
<p>as fancyZoom can add Zoom effect to both images and text. So you can put img tag or text to the above template.</p>
<p>Here is an example on how to add thumbnail image to the post, and popup a lightbox with a full sized image on click.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;photo&quot;&gt;    
      &lt;a href=&quot;#image1&quot;&gt;
           &lt;img src=&quot;http://demo.pengbos.com/corporattica/wp-content/uploads/2011/03/portfolio-150x150.jpg&quot; alt=&quot;&quot; title=&quot;portfolio&quot; width=&quot;150&quot; height=&quot;150&quot; class=&quot;aligncenter size-thumbnail wp-image-37&quot; /&gt;
      &lt;/a&gt;
&lt;/div&gt;    
&lt;div id=&quot;image1&quot;&gt;
       &lt;img src=&quot;http://demo.pengbos.com/corporattica/wp-content/uploads/2011/03/portfolio.jpg&quot; alt=&quot;&quot; title=&quot;portfolio&quot; width=&quot;492&quot; height=&quot;280&quot; class=&quot;aligncenter size-full wp-image-37&quot; /&gt;
&lt;/div&gt;</pre></div></div>

<p>see the final effect from the demo here <a href="http://demo.pengbos.com/corporattica/?p=13" target="_blank"> http://demo.pengbos.com/corporattica/?p=13</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pengbos.com/blog/corporattica-theme-how-to-enable-lightbox-in-post/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Corporattica Theme: Can&#8217;t Send Email Bug Fixed</title>
		<link>http://pengbos.com/blog/corporattica-theme-cant-send-email-bug-fixed</link>
		<comments>http://pengbos.com/blog/corporattica-theme-cant-send-email-bug-fixed#comments</comments>
		<pubDate>Tue, 26 Jul 2011 23:05:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[corporattica]]></category>
		<category><![CDATA[email]]></category>

		<guid isPermaLink="false">http://pengbos.com/?p=730</guid>
		<description><![CDATA[A Corporattica user reported that the contact form is broken, as he cannot send messages. This is a bug in the js code. To fix this bug: 1. Just download the theme again, I have already uploaded the fixed version. Replace the theme files with the latest files. 2. You can also fix it by [...]]]></description>
			<content:encoded><![CDATA[<p>A Corporattica user reported that the contact form is broken, as he cannot send messages. This is a bug in the js code.</p>
<p>To fix this bug:</p>
<p>1. Just download the theme again, I have already uploaded the fixed version. Replace the theme files with the latest files.</p>
<p>2. You can also fix it by yourself follow the steps:</p>
<li>go to js\contact.js</li>
<li>go to line 62. Change the &#8220;#contact_form&#8221; to &#8220;#contacts&#8221;</li>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">post</span><span style="color: #009900;">&#40;</span>theme_template_dir<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;/send_email.php&quot;</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#contacts&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>result<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></pre></div></div>

<li>
go to line 66. Change &#8220;#button&#8221; to &#8220;#send_message&#8221;.</li>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">	 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#send_message'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>All set!!</p>
]]></content:encoded>
			<wfw:commentRss>http://pengbos.com/blog/corporattica-theme-cant-send-email-bug-fixed/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A Bug in JQuery Latest Release(v1.6.2)</title>
		<link>http://pengbos.com/blog/a-bug-in-jquery-latest-releasev1-6-2</link>
		<comments>http://pengbos.com/blog/a-bug-in-jquery-latest-releasev1-6-2#comments</comments>
		<pubDate>Sat, 16 Jul 2011 16:33:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[read only]]></category>

		<guid isPermaLink="false">http://pengbos.com/?p=688</guid>
		<description><![CDATA[One of My colleagues asked for help on a JavaScript feature. He had several input boxes, and a button. By default, all input boxes are not editable, only when the user clicks the button. It is a very simple feature, and he had already implemented. The problem was, he could not get it work in [...]]]></description>
			<content:encoded><![CDATA[<p>One of My colleagues asked for help on a JavaScript feature. He had several input boxes, and a button. By default, all input boxes are not editable, only when the user clicks the button. It is a very simple feature, and he had already implemented. The problem was, he could not get it work in IE. (IE 8 support is a &#8220;must&#8221; in the company) .<br />
<span id="more-688"></span><br />
Here is a tailored version of his code (simplified):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
&lt;title&gt;pengbo's readonly test&lt;/title&gt;
&lt;script
	src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js&quot;
	type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;center&gt;
&lt;h2&gt;Readonly?&lt;/h2&gt;
&lt;table&gt;
	&lt;tr&gt;
		&lt;td&gt;username&lt;/td&gt;
		&lt;td&gt;&lt;input name=&quot;username&quot; type=&quot;text&quot; value=&quot;pengbos&quot; size=70 id=&quot;username&quot;
			class=&quot;inputbox&quot; /&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;mail_to_adderss&lt;/td&gt;
		&lt;td&gt;&lt;input name=&quot;mail_to_address&quot; type=&quot;text&quot; id=&quot;mail_to_address&quot;
			value=&quot;pengbos.com@gmail.com&quot; size=70 class=&quot;inputbox&quot; /&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td align=&quot;center&quot; colspan=&quot;2&quot;&gt;&lt;input type=&quot;button&quot; value=&quot;edit&quot;
			onclick=&quot;submitClick(this)&quot;&gt;&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;/center&gt;
&lt;/body&gt;
&lt;script&gt;
	function submitClick(b) {
		if (b.value == &quot;edit&quot;) {
			b.value = &quot;submit&quot;;
			$(&quot;.inputbox&quot;).attr(&quot;readonly&quot;, false);
&nbsp;
		} else if (b.value == &quot;submit&quot;) {
			b.value = &quot;edit&quot;;
			$(&quot;.inputbox&quot;).attr(&quot;readonly&quot;, true);
		}
	}
	$(&quot;document&quot;).ready(function() {
		$(&quot;.inputbox&quot;).attr(&quot;readonly&quot;, true);
	});
&lt;/script&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p>it worked in Firefox, but it just did not work in IE 8 (or other IE versions like IE 6,7 ).</p>
<p>Test it against FF/IE: <a href="http://pengbos.com/wp-content/demo/readOnly.html" target="_blank">Demo</a></p>
<p>When i use &#8220;Developer Tools&#8221; to debug, i found that, when i clicked edit, one of the element&#8217;s attribute &#8220;isContentEditable&#8221; is still false.</p>
<p><a href="http://pengbos.com/wp-content/uploads/2011/07/Readable1.png"><img src="http://pengbos.com/wp-content/uploads/2011/07/Readable1.png" alt="" title="Readable" width="620" height="509" class="aligncenter size-full wp-image-708" /></a></p>
<p>If we use raw javascript(without jQuery) to implement this feature, we will write:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">	<span style="color: #003366; font-weight: bold;">function</span> submitClick<span style="color: #009900;">&#40;</span>b<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>b.<span style="color: #660066;">value</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;edit&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			b.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;submit&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #006600; font-style: italic;">//$(&quot;.inputbox&quot;).attr(&quot;readonly&quot;, false);</span>
			document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;mail_to_address&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;readOnly&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;username&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;readOnly&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>b.<span style="color: #660066;">value</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;submit&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			b.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;edit&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #006600; font-style: italic;">//$(&quot;.inputbox&quot;).attr(&quot;readonly&quot;, true);</span>
			document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;mail_to_address&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;readOnly&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;readonly&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;username&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;readOnly&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;readonly&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>And, if we use the debug tool to look into the element, we will find that:</p>
<p><a href="http://pengbos.com/wp-content/uploads/2011/07/ie8-debug.png"><img src="http://pengbos.com/wp-content/uploads/2011/07/ie8-debug.png" alt="" title="ie8-debug" width="577" height="1000" class="aligncenter size-full wp-image-712" target="_blank"/></a></p>
<p>The difference is that the &#8220;isContentEditable&#8221; is changed to &#8220;true&#8221;, which is the expected result. So why does jQuery 1.6.2 not change the value to &#8220;true&#8221;?</p>
<p>Let&#8217;s exam jQuery&#8217;s source code. first, let&#8217;s look at the &#8220;attr&#8221; function</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">attr<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> elem<span style="color: #339933;">,</span> <span style="color: #000066;">name</span><span style="color: #339933;">,</span> value<span style="color: #339933;">,</span> pass <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> nType <span style="color: #339933;">=</span> elem.<span style="color: #660066;">nodeType</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">// don't get/set attributes on text, comment and attribute nodes</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>elem <span style="color: #339933;">||</span> nType <span style="color: #339933;">===</span> <span style="color: #CC0000;">3</span> <span style="color: #339933;">||</span> nType <span style="color: #339933;">===</span> <span style="color: #CC0000;">8</span> <span style="color: #339933;">||</span> nType <span style="color: #339933;">===</span> <span style="color: #CC0000;">2</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">return</span> undefined<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> pass <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066;">name</span> <span style="color: #000066; font-weight: bold;">in</span> jQuery.<span style="color: #660066;">attrFn</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">return</span> jQuery<span style="color: #009900;">&#40;</span> elem <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span> value <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">// Fallback to prop when attributes are not supported</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;getAttribute&quot;</span> <span style="color: #000066; font-weight: bold;">in</span> elem<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">return</span> jQuery.<span style="color: #660066;">prop</span><span style="color: #009900;">&#40;</span> elem<span style="color: #339933;">,</span> <span style="color: #000066;">name</span><span style="color: #339933;">,</span> value <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> ret<span style="color: #339933;">,</span> hooks<span style="color: #339933;">,</span>
			notxml <span style="color: #339933;">=</span> nType <span style="color: #339933;">!==</span> <span style="color: #CC0000;">1</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>jQuery.<span style="color: #660066;">isXMLDoc</span><span style="color: #009900;">&#40;</span> elem <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">// Normalize the name if needed</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> notxml <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">name</span> <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">attrFix</span><span style="color: #009900;">&#91;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#93;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">name</span><span style="color: #339933;">;</span>
&nbsp;
			hooks <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">attrHooks</span><span style="color: #009900;">&#91;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>hooks <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #006600; font-style: italic;">// Use boolHook for boolean attributes</span>
				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> rboolean.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
					hooks <span style="color: #339933;">=</span> boolHook<span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #006600; font-style: italic;">// Use formHook for forms and if the name contains certain characters</span>
				<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> formHook <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066;">name</span> <span style="color: #339933;">!==</span> <span style="color: #3366CC;">&quot;className&quot;</span> <span style="color: #339933;">&amp;&amp;</span>
					<span style="color: #009900;">&#40;</span>jQuery.<span style="color: #660066;">nodeName</span><span style="color: #009900;">&#40;</span> elem<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;form&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> rinvalidChar.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
					hooks <span style="color: #339933;">=</span> formHook<span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> value <span style="color: #339933;">!==</span> undefined <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> value <span style="color: #339933;">===</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				jQuery.<span style="color: #660066;">removeAttr</span><span style="color: #009900;">&#40;</span> elem<span style="color: #339933;">,</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">return</span> undefined<span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> hooks <span style="color: #339933;">&amp;&amp;</span> <span style="color: #3366CC;">&quot;set&quot;</span> <span style="color: #000066; font-weight: bold;">in</span> hooks <span style="color: #339933;">&amp;&amp;</span> notxml <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>ret <span style="color: #339933;">=</span> hooks.<span style="color: #660066;">set</span><span style="color: #009900;">&#40;</span> elem<span style="color: #339933;">,</span> value<span style="color: #339933;">,</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> undefined <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">return</span> ret<span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
				elem.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #339933;">+</span> value <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">return</span> value<span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> hooks <span style="color: #339933;">&amp;&amp;</span> <span style="color: #3366CC;">&quot;get&quot;</span> <span style="color: #000066; font-weight: bold;">in</span> hooks <span style="color: #339933;">&amp;&amp;</span> notxml <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>ret <span style="color: #339933;">=</span> hooks.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span> elem<span style="color: #339933;">,</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">return</span> ret<span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			ret <span style="color: #339933;">=</span> elem.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #006600; font-style: italic;">// Non-existent attributes return null, we normalize to undefined</span>
			<span style="color: #000066; font-weight: bold;">return</span> ret <span style="color: #339933;">===</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #339933;">?</span>
				undefined <span style="color: #339933;">:</span>
				ret<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></td></tr></table></div>

<p>we can also debug the code step by step in the developer tool. the passed in parameters are: name is &#8220;readOnly&#8221; value is &#8220;false&#8221;<br />
when the regular express rboolean test this name readOnly, it returns true as it is a boolean attribute. So there is a boolean hook involved: boolHook (see the highlighted line by yellow in the following diagram).</p>
<p><a href="http://pengbos.com/wp-content/uploads/2011/07/attr.png" target="_blank"><img src="http://pengbos.com/wp-content/uploads/2011/07/attr.png" alt="" title="attr" width="616" height="756" class="aligncenter size-full wp-image-716"/></a></p>
<p>as the passed in value is false, and there is a boolHook, the code runs into the line 49.</p>
<p>the boolean hook calls set function</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Hook for boolean attributes</span>
boolHook <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	set<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> elem<span style="color: #339933;">,</span> value<span style="color: #339933;">,</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> propName<span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> value <span style="color: #339933;">===</span> <span style="color: #003366; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #006600; font-style: italic;">// Remove boolean attributes when set to false</span>
			jQuery.<span style="color: #660066;">removeAttr</span><span style="color: #009900;">&#40;</span> elem<span style="color: #339933;">,</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #006600; font-style: italic;">// value is true since we know at this point it's type boolean and not false</span>
			<span style="color: #006600; font-style: italic;">// Set boolean attributes to the same name and set the DOM property</span>
			propName <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">propFix</span><span style="color: #009900;">&#91;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#93;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">name</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> propName <span style="color: #000066; font-weight: bold;">in</span> elem <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #006600; font-style: italic;">// Only set the IDL specifically if it already exists on the element</span>
				elem<span style="color: #009900;">&#91;</span> propName <span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			elem.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span><span style="color: #339933;">,</span> <span style="color: #000066;">name</span>.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066;">name</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The boolean hook is really simple, if the value is false, remove the attribute, and if the value is true, it set attribute. In our case, it calls &#8220;jQuery.removeAttr( elem, name );&#8221;</p>
<p>following is the remove Attr function</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">	removeAttr<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> elem<span style="color: #339933;">,</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> propName<span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> elem.<span style="color: #660066;">nodeType</span> <span style="color: #339933;">===</span> <span style="color: #CC0000;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">name</span> <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">attrFix</span><span style="color: #009900;">&#91;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#93;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">name</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> jQuery.<span style="color: #660066;">support</span>.<span style="color: #660066;">getSetAttribute</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #006600; font-style: italic;">// Use removeAttribute in browsers that support it</span>
				elem.<span style="color: #660066;">removeAttribute</span><span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
				jQuery.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span> elem<span style="color: #339933;">,</span> <span style="color: #000066;">name</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				elem.<span style="color: #660066;">removeAttributeNode</span><span style="color: #009900;">&#40;</span> elem.<span style="color: #660066;">getAttributeNode</span><span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #006600; font-style: italic;">// Set corresponding property to false for boolean attributes</span>
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> rboolean.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>propName <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">propFix</span><span style="color: #009900;">&#91;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#93;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">in</span> elem <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				elem<span style="color: #009900;">&#91;</span> propName <span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></td></tr></table></div>

<p>In IE the criteria:  jQuery.support.getSetAttribute is false. So the code runs into<br />
jQuery.attr( elem, name, &#8220;&#8221; );<br />
elem.removeAttributeNode( elem.getAttributeNode( name ) );</p>
<p>and it calls attr function again. This time, the passed in value is an empty string instead of false.</p>
<p>but when the code runs into the boolean regular expression check, it only checks the name. (code line 30 in the attr function) and it get the boolHook again. And then the code runs into hoolHook&#8217;s set function. It is different from the first invocation, at this time, the passed in value is an empty string, instead of false. However, boolHook takes this values as &#8220;true&#8221;(see code at line 8 of boolHook&#8217;s set function). And it call elem.setAttribute( name, name.toLowerCase() ); it is totally not expected. </p>
<p>As in the attr function (line 30), it does not check if the value is boolean or string. but in fact, we need to check the value as well, if value is a boolen, then introduce hook, otherwise, don&#8217;t use boolHook.</p>
<p>If change the code to check the value type as well, the hooks will not be assigned a boolHook. And the code will run to line 53 in attr function. the result is just the same as our raw javascript way. And it will change the &#8220;isContentEditable&#8221; value during the removeAttr call.</p>
<p>so the code in line 30 in the attr function can be changed to:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Use boolHook for boolean attributes</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> rboolean.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span>
	<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> value <span style="color: #339933;">===</span> <span style="color: #3366CC;">&quot;boolean&quot;</span> <span style="color: #339933;">||</span> value <span style="color: #339933;">===</span> undefined <span style="color: #339933;">||</span> value.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #000066;">name</span>.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	hooks <span style="color: #339933;">=</span> boolHook<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Actually, jQuery 1.6.1 is doing this way. I am not sure why does version 1.6.2 have this change.</p>
<p>Thats&#8217; what i found. Hope it help you with &#8220;readOnly&#8221; issues too.</p>
]]></content:encoded>
			<wfw:commentRss>http://pengbos.com/blog/a-bug-in-jquery-latest-releasev1-6-2/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Single Page Implementation: My Licence 2 Drive Site</title>
		<link>http://pengbos.com/portfolio/single-page-implementation-my-licence-2-drive-site</link>
		<comments>http://pengbos.com/portfolio/single-page-implementation-my-licence-2-drive-site#comments</comments>
		<pubDate>Tue, 07 Jun 2011 07:29:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[single page]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://pengbos.com/?p=676</guid>
		<description><![CDATA[This project was finished on May. My License 2 Drive was developed in conjunction with Lee Cant and flidesigns. Single Page Website design is a new design style, which is getting more popular for its better user experience and fascinating animation. And it becomes hot new trend in website design. This is my first time [...]]]></description>
			<content:encoded><![CDATA[<p>This project was finished on May. My License 2 Drive was developed in conjunction with Lee Cant and <a href="http://flidesigns.blogspot.com/">flidesigns</a>.<br />
<span id="more-676"></span><br />
Single Page Website design is a new design style, which is getting more popular for its better user experience and fascinating animation. And it becomes hot new trend in website design.</p>
<p>This is my first time to corporate with a design company. As i am better in developing than design, and flidesigns is a professional design company, so this kind of corporation is really very beneficial to both of us. And it is a good experience to corporate with a design agent. A good start.</p>
]]></content:encoded>
			<wfw:commentRss>http://pengbos.com/portfolio/single-page-implementation-my-licence-2-drive-site/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

