<?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>itlivewire dev blog &#187; jquery</title>
	<atom:link href="http://itlivewire.com/devblog/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://itlivewire.com/devblog</link>
	<description>Just another web development blog...</description>
	<lastBuildDate>Mon, 16 Apr 2012 12:37:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Jquery covered by the parent technique</title>
		<link>http://itlivewire.com/devblog/2012/03/07/jquery-covered-by-the-parent-technique/</link>
		<comments>http://itlivewire.com/devblog/2012/03/07/jquery-covered-by-the-parent-technique/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 20:35:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://itlivewire.com/devblog/?p=491</guid>
		<description><![CDATA[We always encounter them on our JavaScript apps, the dynamic elements, most of the time they are in the form of new rows in the table &#60;tr&#62;&#60;td&#62;&#60;/td&#62;&#60;/tr&#62; or a new list &#60;li&#62; from a &#60;ul&#62;. So sometimes we need to capture an event to these newly loaded dynamic elements, and the solution in jquery is [...]]]></description>
			<content:encoded><![CDATA[<p>We always encounter them on our JavaScript apps, the<strong> <a href="http://stackoverflow.com/questions/867916/creating-a-div-element-in-jquery">dynamic elements</a></strong>, most of the time they are in the form of new rows in the table &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt; or a new list &lt;li&gt; from a &lt;ul&gt;.</p>
<p>So sometimes we need to capture an event to these newly loaded dynamic elements, and the solution in jquery is to use the <strong><a href="http://api.jquery.com/live/">live</a> </strong>function.</p>
<p>Alternatively we can also use the covered by the parent technique, so if the parent of the dynamic element is loaded manually, we can just capture the event by this code.</p>
<pre class="brush: php;">
$('ul').on('click','li',function(){
    alert('Has been clicked.. Do something next');
})
</pre>
<p>With the code on top we have eliminated the use of making this line</p>
<pre class="brush: php;">
$('li').live('click',function(){
    alert('Has been clicked.. Do something next');
});
</pre>
<p>because the event for <strong> &lt;li&gt;</strong> has been covered by the parent  <strong>&lt;ul&gt;</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://itlivewire.com/devblog/2012/03/07/jquery-covered-by-the-parent-technique/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery perfomance tips</title>
		<link>http://itlivewire.com/devblog/2011/12/14/jquery-perfomance-tips/</link>
		<comments>http://itlivewire.com/devblog/2011/12/14/jquery-perfomance-tips/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 19:20:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://itlivewire.com/devblog/?p=459</guid>
		<description><![CDATA[I have just stumbled on this performance tip so I tried and tested it, so far the results were good there are some speed improvement on my jquery codes. Optimize selectors for Sizzle’s ‘right to left’ model As of version 1.3, jQuery has been using the Sizzle Javascript Selector Library which works a bit differently [...]]]></description>
			<content:encoded><![CDATA[<p>I have just stumbled on this performance tip so I tried and tested it, so far the results were good there are some speed improvement on my jquery codes.</p>
<p>Optimize selectors for Sizzle’s ‘right to left’ model<br />
As of version 1.3, jQuery has been using the Sizzle Javascript Selector Library which works a bit differently from the selector engine used in the past. Namely it uses a ‘right to left’ model rather than a ‘left to right’. Make sure that your right-most selector is really specific and any selectors on the left are more broad:</p>
<p><strong>var linkContacts = $(&#8216;.contact-links div.side-wrapper&#8217;);</strong></p>
<p>instead of:</p>
<p><strong>var linkContacts = $(&#8216;a.contact-links .side-wrapper&#8217;);</strong></p>
<p><em>More tips from this website</em><br />
<a href="http://dumitruglavan.com/jquery-performance-tips-cheat-sheet/">http://dumitruglavan.com/jquery-performance-tips-cheat-sheet/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://itlivewire.com/devblog/2011/12/14/jquery-perfomance-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>top jquery plugins of 2009</title>
		<link>http://itlivewire.com/devblog/2009/12/27/top-jquery-plugins-of-2009/</link>
		<comments>http://itlivewire.com/devblog/2009/12/27/top-jquery-plugins-of-2009/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 15:08:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://itlivewire.com/devblog/2009/12/27/top-jquery-plugins-of-2009/</guid>
		<description><![CDATA[woorkup features the top jquery plugins of 2009 http://woorkup.com/2009/12/27/10-popular-jquery-plugins-in-2009-you-can%E2%80%99t-miss/ includes the very impressive mapbox and jqtouch]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://woorkup.com/2009/12/27/10-popular-jquery-plugins-in-2009-you-can%E2%80%99t-miss/">woorkup</a></strong> features the top jquery plugins of 2009 </p>
<p><a href="http://woorkup.com/2009/12/27/10-popular-jquery-plugins-in-2009-you-can%E2%80%99t-miss/">http://woorkup.com/2009/12/27/10-popular-jquery-plugins-in-2009-you-can%E2%80%99t-miss/</a></p>
<p>includes the very impressive <strong><a href="http://wayfarerweb.com/jquery/plugins/mapbox/">mapbox</a></strong> and <strong><a href="http://www.jqtouch.com/">jqtouch</a></strong><br />
<a href="http://woorkup.com/2009/12/27/10-popular-jquery-plugins-in-2009-you-can%E2%80%99t-miss/"><img src="http://woorkup.com/wp-content/uploads/2009/12/jqp14.jpg" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://itlivewire.com/devblog/2009/12/27/top-jquery-plugins-of-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery dynamically update table rows data</title>
		<link>http://itlivewire.com/devblog/2008/12/01/jquery-dynamically-update-table-rows-data/</link>
		<comments>http://itlivewire.com/devblog/2008/12/01/jquery-dynamically-update-table-rows-data/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 02:58:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://itlivewire.com/devblog/?p=35</guid>
		<description><![CDATA[To dynamically change the table rows use this smart approach using jquery Assign your new table data rows to a variable var msg="&#60;tr&#62;&#60;td&#62;Kristine&#60;/td&#62;&#60;td&#62;18&#60;/td&#62;&#60;td&#62;peach&#60;/td&#62;&#60;/tr&#62;&#60;tr&#62;&#60;td&#62;Vanessa&#60;/td&#62;&#60;td&#62;25&#60;/td&#62;&#60;td&#62;strawberry&#60;/td&#62;&#60;/tr&#62;"; Delete the exsiting rows except for the header tr:first &#8211; represents first row of the table &#8211; which happens to be our header $("tableÂ tr:first").siblings().remove(); Then add the new data, the msg javascript [...]]]></description>
			<content:encoded><![CDATA[<p><strong>To dynamically change the table rows use this smart approach using jquery</strong></p>
<p>Assign your new table data rows to a variable<br />
<strong><code class="js"><span class="js__statement">var</span> msg=<span class="js__string">"&lt;tr&gt;&lt;td&gt;Kristine&lt;/td&gt;&lt;td&gt;18&lt;/td&gt;&lt;td&gt;peach&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Vanessa&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;strawberry&lt;/td&gt;&lt;/tr&gt;"</span>; </code></strong></p>
<p>Delete the exsiting rows except for the header <strong>tr:first</strong> &#8211; represents first row of the table &#8211; which happens to be our header<br />
<strong><code class="js">$(<span class="js__string">"tableÂ tr:first"</span>).siblings().remove(); </code></strong><br />
<code class="js"><br />
Then add the new data, the <strong>msg</strong> javascript variable used here holds the new table rows data<br />
<strong>$(<span class="js__string">"tableÂ tr:first"</span>).after(msg);</p>
<p></strong>I have a very detailed step by step tutorial you can <strong><a href="http://itlivewire.com/tuts/jquery-dynamically-change-table-rows.html" target="_blank">view here</a></strong></code></p>
]]></content:encoded>
			<wfw:commentRss>http://itlivewire.com/devblog/2008/12/01/jquery-dynamically-update-table-rows-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jquery best practices</title>
		<link>http://itlivewire.com/devblog/2008/10/08/jquery-best-practices/</link>
		<comments>http://itlivewire.com/devblog/2008/10/08/jquery-best-practices/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 12:08:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://itlivewire.com/devblog/?p=14</guid>
		<description><![CDATA[From Smashing Magazine Rule #1: Separate Javascript Functionality Bad markup: Never include Javascript events as inline attributes. This practice should be completely wiped from your mind. &#60;a onclick=&#8220;doSomething()&#8221; href=&#8220;#&#8221;&#62;Click!&#60;/a&#62; &#60;a onclick="doSomething()" href="#"&#62;Click!&#60;/a&#62; Good markup: All Javascript behaviours should be included in external script files and linked to the document with a &#60;a href=&#8220;backuplink.html&#8221; class=&#8220;doSomething&#8221;&#62;Click!&#60;/a&#62; &#60;a [...]]]></description>
			<content:encoded><![CDATA[<p>From<strong> <a href="http://www.smashingmagazine.com/2008/09/16/jquery-examples-and-best-practices/" target="_blank">Smashing Magazine</a></strong></p>
<h4>Rule #1: Separate Javascript Functionality</h4>
<h5>Bad markup:</h5>
<p>Never include Javascript events as inline attributes. This practice should be completely wiped from your mind.</p>
<div class="dp-highlighter">
<div class="bar">
<div class="tools"><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="http://www.smashingmagazine.com/2008/09/16/jquery-examples-and-best-practices/#"></a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="http://www.smashingmagazine.com/2008/09/16/jquery-examples-and-best-practices/#"><br />
</a></div>
</div>
<ol class="dp-xml">
<li class="alt"><span><span class="tag">&lt;</span><span class="tag-name">a</span><span> </span><span class="attribute">onclick</span><span>=</span><span class="attribute-value">&#8220;doSomething()&#8221;</span><span> </span><span class="attribute">href</span><span>=</span><span class="attribute-value">&#8220;#&#8221;</span><span class="tag">&gt;</span><span>Click!</span><span class="tag">&lt;/</span><span class="tag-name">a</span><span class="tag">&gt;</span><span> </span></span></li>
</ol>
</div>
<pre class="html" style="display: none;">&lt;a onclick="doSomething()" href="#"&gt;Click!&lt;/a&gt;</pre>
<h5>Good markup:</h5>
<p>All Javascript behaviours should be included in external script files and linked to the document with a</p>
<div class="dp-highlighter">
<ol class="dp-xml">
<li class="alt"><span><span class="tag">&lt;</span><span class="tag-name">a</span><span> </span><span class="attribute">href</span><span>=</span><span class="attribute-value">&#8220;backuplink.html&#8221;</span><span> </span><span class="attribute">class</span><span>=</span><span class="attribute-value">&#8220;doSomething&#8221;</span><span class="tag">&gt;</span><span>Click!</span><span class="tag">&lt;/</span><span class="tag-name">a</span><span class="tag">&gt;</span><span> </span></span></li>
</ol>
</div>
<pre class="html" style="display: none;">&lt;a href="backuplink.html" class="doSomething"&gt;Click!&lt;/a&gt;</pre>
<p>And the Javascript inside the myscript.js file would contain something like this:</p>
<div class="dp-highlighter">
<div class="bar">
<div class="tools"><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="http://www.smashingmagazine.com/2008/09/16/jquery-examples-and-best-practices/#"></a></p>
<ol class="dp-c">
<li class="alt"><span>$(<span class="string">&#8216;a.doSomething&#8217;</span><span>).click(</span><span class="keyword">function</span><span>(){ </span></span></li>
<li><span> <span class="comment">//Â DoÂ somethingÂ here!</span><span> </span></span></li>
<li class="alt"><span> alert(<span class="string">&#8216;YouÂ didÂ something,Â wooÂ hoo!&#8217;</span><span>); </span></span></li>
<li><span>});</span></li>
</ol>
<p><span>More best practices can be at </span><strong><a href="http://www.smashingmagazine.com/2008/09/16/jquery-examples-and-best-practices/" target="_blank">Smashing Magazine</a></strong></p>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://itlivewire.com/devblog/2008/10/08/jquery-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jquery Multi Column Select Box</title>
		<link>http://itlivewire.com/devblog/2008/10/08/jquery-multi-column-select-box/</link>
		<comments>http://itlivewire.com/devblog/2008/10/08/jquery-multi-column-select-box/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 04:35:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://itlivewire.com/devblog/?p=12</guid>
		<description><![CDATA[A jquery plugin that creates a multiple column selectbox Donwload plugin at: http://code.google.com/p/jquerymulticolumnselectbox/ Directions for Use: 1. Include of course jquery.js and jquery.multicolselect.js &#60;script type=&#8221;text/javascript&#8221; src=&#8221;jquery.js&#8221;&#62;&#60;/script&#62; &#60;script type=&#8221;text/javascript&#8221; src=&#8221;jquery.multicolselect.js&#8221;&#62;&#60;/script&#62; 2. Create a table put an id to the div &#8220;ex. datatable&#8221; &#60;div id=&#8221;datatable&#8221;&#62; &#60;table cellspacing=&#8221;0&#8243; width=&#8221;100%&#8221;&#62; &#60;tr&#62; &#60;th&#62;ID&#60;/th&#62;&#60;th&#62;Key&#60;/th&#62;&#60;th&#62;Fruit&#60;/th&#62; &#60;/tr&#62; &#60;tr&#62; &#60;td&#62;1&#60;/td&#62;&#60;td&#62;1234&#60;/td&#62;&#60;td&#62;Apple&#60;/td&#62; &#60;/tr&#62; &#60;tr&#62; &#60;td&#62;2&#60;/td&#62;&#60;td&#62;1111&#60;/td&#62;&#60;td&#62;Cat&#60;/td&#62; &#60;/tr&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>A jquery plugin that creates a multiple column selectbox<br />
Donwload plugin at: <strong><a href="http://code.google.com/p/jquerymulticolumnselectbox/" target="_blank">http://code.google.com/p/jquerymulticolumnselectbox/</a></strong><br />
<a href="http://itlivewire.com/devblog/wp-content/uploads/2008/10/multicolselect.gif"><img class="alignnone size-full wp-image-13" title="multicolselect" src="http://itlivewire.com/devblog/wp-content/uploads/2008/10/multicolselect.gif" alt="" width="179" height="107" /></a><a href="http://itlivewire.com/devblog/wp-content/uploads/2008/10/multicolselect.gif"><br />
</a></p>
<p>Directions for Use:</p>
<p>1. Include of course jquery.js and jquery.multicolselect.js</p>
<div style="padding: 5px; background: #eeeeee none repeat scroll 0% 0%; font-size: 12px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">&lt;script type=&#8221;text/javascript&#8221; src=&#8221;jquery.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;jquery.multicolselect.js&#8221;&gt;&lt;/script&gt;</div>
<p>2. Create a table put an id to the div &#8220;ex. datatable&#8221;</p>
<div style="padding: 5px; background: #eeeeee none repeat scroll 0% 0%; font-size: 12px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">&lt;div id=&#8221;datatable&#8221;&gt;<br />
&lt;table cellspacing=&#8221;0&#8243; width=&#8221;100%&#8221;&gt;<br />
&lt;tr&gt;<br />
&lt;th&gt;ID&lt;/th&gt;&lt;th&gt;Key&lt;/th&gt;&lt;th&gt;Fruit&lt;/th&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;1&lt;/td&gt;&lt;td&gt;1234&lt;/td&gt;&lt;td&gt;Apple&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;2&lt;/td&gt;&lt;td&gt;1111&lt;/td&gt;&lt;td&gt;Cat&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;3&lt;/td&gt;&lt;td&gt;5555&lt;/td&gt;&lt;td&gt;Dog&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&lt;/div&gt;</div>
<p>3. Run the plugin using this command</p>
<div style="padding: 5px; background: #eeeeee none repeat scroll 0% 0%; font-size: 12px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<pre>$("#datatable").multicolselect({
	   		buttonImage:"selectbutton.gif",
			valueCol:1,
	  		hideCol:0
	   });</pre>
</div>
<p>4 .	Note you need the &#8220;selectbutton.gif&#8221; so save it.<br />
5.	Then your done.</p>
<p><strong>Options</strong></p>
<table border="0" cellspacing="1" cellpadding="2" width="100%">
<tbody>
<tr>
<td width="13%">buttonImage</td>
<td width="84%">The source of your button image</td>
<td width="3%"></td>
</tr>
<tr>
<td>valueCol</td>
<td>The column index to be used to display value for the textbox</td>
<td></td>
</tr>
<tr>
<td>hideCol</td>
<td>The column index to hide this is usually an id column</td>
<td></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://itlivewire.com/devblog/2008/10/08/jquery-multi-column-select-box/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

