<?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>jQuery Tutorials &#38; Plugins &#187; subexpression</title>
	<atom:link href="http://jqueryblog.net/tag/subexpression/feed/" rel="self" type="application/rss+xml" />
	<link>http://jqueryblog.net</link>
	<description></description>
	<lastBuildDate>Mon, 05 Jul 2010 08:45:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>jQuery Optimization : Avoid Unnecessary Selector</title>
		<link>http://jqueryblog.net/2009/11/jquery-optimization-avoid-unnecessary-selector/</link>
		<comments>http://jqueryblog.net/2009/11/jquery-optimization-avoid-unnecessary-selector/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 15:38:35 +0000</pubDate>
		<dc:creator>Osman Erdo&#287;an</dc:creator>
				<category><![CDATA[jQuery Optimization]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[Selector]]></category>
		<category><![CDATA[subexpression]]></category>
		<category><![CDATA[Unnecessary Selector]]></category>

		<guid isPermaLink="false">http://jqueryblog.net/?p=29</guid>
		<description><![CDATA[Common subexpression elimination is a common way to optimize any programming code. Doing unnecessary selector is expensive. Doing something like this:
jQuery('.class').each(function(){
	jQuery(this).html();
	jQuery(this).find('div').each(function(){
		//etc.
	});
});
which required many selector it is best to use 1 instead since we are repeating ourselves and doing some redundant selector.
jQuery('.class').each(function(){
	var obj = jQuery(this);
	obj.html();
	obj.find('div').each(function(){
		//etc.
	});
});
This is something that we often see in many plugin. Many plugin [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjqueryblog.net%2F2009%2F11%2Fjquery-optimization-avoid-unnecessary-selector%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjqueryblog.net%2F2009%2F11%2Fjquery-optimization-avoid-unnecessary-selector%2F" height="61" width="51" /></a></div><p>Common subexpression elimination is a common way to optimize any programming code. Doing unnecessary selector is expensive. Doing something like this:</p>
<pre class="brush: jscript;">jQuery('.class').each(function(){
	jQuery(this).html();
	jQuery(this).find('div').each(function(){
		//etc.
	});
});</pre>
<p>which required many selector it is best to use 1 instead since we are repeating ourselves and doing some redundant selector.</p>
<pre class="brush: jscript;">jQuery('.class').each(function(){
	var obj = jQuery(this);
	obj.html();
	obj.find('div').each(function(){
		//etc.
	});
});</pre>
<p>This is something that we often see in many plugin. Many plugin contains unnecessary selector which degrade the perform of the plugin little by little.</p>
]]></content:encoded>
			<wfw:commentRss>http://jqueryblog.net/2009/11/jquery-optimization-avoid-unnecessary-selector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

