<?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>MaX&#039;s Blog &#187; MaX</title>
	<atom:link href="http://max.jsrhost.com/author/skmd/feed/" rel="self" type="application/rss+xml" />
	<link>http://max.jsrhost.com</link>
	<description>Welcome everybody to my blog</description>
	<lastBuildDate>Thu, 01 Apr 2010 20:37:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>More than 25 Excellent Tips to Improve jQuery</title>
		<link>http://max.jsrhost.com/2009/04/20/more-than-25-excellent-tips-to-improve-jquery/</link>
		<comments>http://max.jsrhost.com/2009/04/20/more-than-25-excellent-tips-to-improve-jquery/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 22:25:40 +0000</pubDate>
		<dc:creator>MaX</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[improve]]></category>
		<category><![CDATA[Speed]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://maxblog.me/?p=185</guid>
		<description><![CDATA[I have just found this article on the internet and it has a lot of great tips. some of them I was already aware of ,  and some are not. This article was originally written by Jon Hobbs-Smith. but It will be modified a little bit and I may add some more tips. Introduction jQuery [...]]]></description>
			<content:encoded><![CDATA[<p>I have just found this article on the internet and it has a lot of great tips. some of them I was already aware of ,  and some are not. This article was originally written by <a href="http://www.tvidesign.co.uk/blog/improve-your-jquery-25-excellent-tips.aspx">Jon Hobbs-Smith</a>. but It will be modified a little bit and I may add some more tips.</p>
<h3>Introduction</h3>
<p>jQuery is awesome. I&#8217;ve been using it for about a year now and although I was impressed to begin with I&#8217;m liking it more and more the longer I use it and the more I find out about it&#8217;s inner workings.</p>
<p>I&#8217;m no jQuery expert. I don&#8217;t claim to be, so if there are mistakes in this article then feel free to correct me or make suggestions for improvements.</p>
<p>I&#8217;d call myself an &#8220;intermediate&#8221; jQuery user and I thought some others out there could benefit from all the little tips, tricks and techniques I&#8217;ve learned over the past year. The article also ended up being a lot longer than I thought it was going to be so I&#8217;ll start with a table of contents so you can skip to the bits you&#8217;re interested in.</p>
<h3>Table of Contents</h3>
<ul>
<li><a href="#tip1"> 1.  Load the framework from Google Code</a></li>
<li><a href="#tip2"> 2.  Use a cheat sheet</a></li>
<li><a href="#tip3"> 3.  Combine all your scripts and minify them</a></li>
<li><a href="#tip4"> 4.  Use Firebug&#8217;s excellent console logging facilities</a></li>
<li><a href="#tip5"> 5.  Keep selection operations  to a minimum by caching</a></li>
<li><a href="#tip6"> 6.  Keep DOM manipulation to a minimum</a></li>
<li><a href="#tip7"> 7.  Wrap everything in a single element when doing any kind of DOM insertion</a></li>
<li><a href="#tip8"> 8.  Use IDs instead of classes wherever possible</a></li>
<li><a href="#tip9"> 9.  Give your selectors a context</a></li>
<li><a href="#tip10">10.  Use chaining properly</a></li>
<li><a href="#tip11">11.  Learn to use animate properly</a></li>
<li><a href="#tip12">12.  Learn about event delegation</a></li>
<li><a href="#tip13">13.  Use classes to store state</a></li>
<li><a href="#tip14">14.  Even better, use jQuery&#8217;s internal data() method to store state</a></li>
<li><a href="#tip15">15.  Write your own selectors</a></li>
<li><a href="#tip16">16.  Streamline your HTML and modify it once the page has loaded</a></li>
<li><a href="#tip17">17.  Lazy load content for speed and SEO benefits</a></li>
<li><a href="#tip18">18.  Use jQuery&#8217;s utility functions</a></li>
<li><a href="#tip19">19.  Use noconflict to rename the jquery object when using other frameworks</a></li>
<li><a href="#tip20">20.  How to tell when images have loaded</a></li>
<li><a href="#tip21">21.  Always use the latest version</a></li>
<li><a href="#tip22">22.  How to check if an element exists</a></li>
<li><a href="#tip23">23.  Add a JS class to your HTML attribute</a></li>
<li><a href="#tip24">24.  Return &#8216;false&#8217; to prevent default behaviour</a></li>
<li><a href="#tip25">25.  Shorthand for the ready event</a></li>
</ul>
<p><a name="tip1"></a></p>
<h3>1. Load the framework from Google Code</h3>
<p>Google have been hosting several JavaScript libraries for a while now on Google Code and there are several advantages to loading it from them instead of from your server. It saves on bandwidth, it&#8217;ll load very quickly from Google&#8217;s CDN and most importantly it&#8217;ll already be cached if the user has visited a site which delivers it from Google Code.</p>
<p>This makes a lot of sense. How many sites out there are serving up identical copies of jQuery that aren&#8217;t getting cached? It&#8217;s easy to do too&#8230;</p>
<pre class="brush: html">
&amp;amp;amp;amp;lt;script src=&quot;http://www.google.com/jsapi&quot;&amp;amp;amp;gt;&amp;amp;amp;amp;lt;/script&amp;amp;amp;gt;
&amp;amp;amp;lt;script type=&quot;text/javascript&quot;&amp;amp;amp;gt;

// Load jQuery
google.load(&quot;jquery&quot;, &quot;1.2.6&quot;);

google.setOnLoadCallback(function() {
// Your code goes here.
});

&amp;amp;amp;lt;/script&amp;amp;amp;gt;
</pre>
<p>Or, you can just include a direct reference like this&#8230;</p>
<pre class="brush: html">
&amp;amp;amp;amp;lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js&quot; type=&quot;text/javascript&quot;&amp;amp;amp;gt;&amp;amp;amp;amp;lt;/script&amp;amp;amp;gt;
</pre>
<p><a href="http://code.google.com/apis/ajaxlibs/documentation/index.html">Full instructions here</a></p>
<p><a name="tip2"></a></p>
<h3>2. Use a cheat sheet</h3>
<p>Not just a jQuery tip, there are some great cheat sheets out there for most languages. It&#8217;s handy having every function on a printable A4 sheet for reference and luckily these guys have produced a couple of nice ones..</p>
<p><a href="http://www.gscottolson.com/weblog/2008/01/11/jquery-cheat-sheet/">http://www.gscottolson.com/weblog/2008/01/11/jquery-cheat-sheet/</a></p>
<p><a href="http://colorcharge.com/jquery/">http://colorcharge.com/jquery/</a></p>
<p><a name="tip3"></a></p>
<h3>3. Combine all your scripts and minify them</h3>
<p>OK, a general JavaScript tip here. But any big project that uses lots of jQuery probably uses lots of plugins (this site uses easing, localScroll, lightbox and preload) so it&#8217;s usually applicable.</p>
<p>Browsers can&#8217;t load scripts concurrently (well, most can&#8217;t, yet), which means that if you&#8217;ve got several scripts downloading one at a time then you&#8217;re really slowing down the loading of your page. So, assuming the scrips are being loaded on every page then you should consider combining them into one long script before deploying.</p>
<p>Some of the plugins will already be minified, but you should consider packing your scripts and any that aren&#8217;t already. It only takes a few seconds. I&#8217;m personally a fan of <a href="http://dean.edwards.name/packer/">Packer by Dean Edwards</a></p>
<p><a name="tip4"></a></p>
<h3>4. Use Firebug&#8217;s excellent console logging facilities</h3>
<p>If you haven&#8217;t already installed Firebug then you really should. Aside from many other useful features such as allowing you to inspect http traffic and find problems with your CSS it has excellent logging commands that allow you to easily debug your scripts.</p>
<p><a href="http://getfirebug.com/console.html">Here&#8217;s a full explanation of all of it&#8217;s features</a></p>
<p>My favourite features are &#8220;console.info&#8221;, which you can use to just dump messages and variables to the screen without having to use alert boxes and &#8220;console.time&#8221; which allows you to easily set up a timer to wrap a bunch of code and see how long it takes. They&#8217;re all really easy to use too&#8230;</p>
<pre class="brush: js">
console.time(&#039;create list&#039;);

for (i = 0; i &amp;amp;amp;lt; 1000; i++) {
var myList = $(&#039;.myList&#039;);
myList.append(&#039;This is list item &#039; + i);
}

console.timeEnd(&#039;create list&#039;);
</pre>
<p>In this instance I&#8217;ve deliberately written some very inefficient code! In the next few tips I&#8217;ll show you how we can use the timer to show some improvements which can be made.</p>
<p><a name="tip5"></a></p>
<h3>5. Keep selection operations  to a minimum by caching</h3>
<p>jQuery selectors are awesome. They make selecting any element on the page incredibly simple, but internally they have to do a fair amount of work and if you go mad with them you might find things starting to get pretty slow.</p>
<p>If you&#8217;re selecting the same element time and time again (in a loop for example) then you can just select it once and keep it in memory while you manipulate it to your heart&#8217;s content. Take the following example where we add items to an unordered list using a loop.</p>
<pre class="brush: js">
for (i = 0; i &amp;amp;amp;lt; 1000; i++) {
var myList = $(&#039;.myList&#039;);
myList.append(&#039;This is list item &#039; + i);
}
</pre>
<p>That takes 1066 milliseconds on my PC in Firefox 3 (imagine how long it would IE6!), which is pretty slow in JavaScript terms. Now take a look at the following code where we use the selector just once.</p>
<pre class="brush: js">
var myList = $(&#039;.myList&#039;);

for (i = 0; i &amp;amp;amp;lt; 1000; i++) {
myList.append(&#039;This is list item &#039; + i);
}
</pre>
<p>That only takes 224 milliseconds, more than 4x faster, just by moving one line of code.</p>
<p><a name="tip6"></a></p>
<h3>6. Keep DOM manipulation to a minimum</h3>
<p>We can make the code from the previous tip even faster by cutting down on the number of times we insert into the DOM. DOM insertion operations like .append() .prepend() .after() and .wrap() are relatively costly and performing lots of them can really slow things down.</p>
<p>All we need to do is use string concatenation to build the list and then use a single function to add them to your unordered list like .html() is much quicker. Take the following example&#8230;</p>
<pre class="brush: js">
var myList = $(&#039;#myList&#039;);

for (i=0; i&amp;amp;amp;lt;1000; i++){
myList.append(&#039;This is list item &#039; + i);
}
</pre>
<p>On my PC that takes 216 milliseconds , just over a 1/5th of a second, but if we build the list items as a string first and use the HTML method to do the insert, like this&#8230;.</p>
<pre class="brush: js">
var myList = $(&#039;.myList&#039;);
var myListItems = &#039;&#039;;

for (i = 0; i &amp;amp;amp;lt; 1000; i++) {
myListItems += &#039;&amp;amp;amp;amp;lt;li&amp;amp;amp;gt;This is list item &#039; + i + &#039;&amp;amp;amp;amp;lt;/li&amp;amp;amp;gt;&#039;;
}

myList.html(myListItems);
</pre>
<p>That takes 185 milliseconds, not much quicker but that&#8217;s another 31 milliseconds off the time.</p>
<p><a name="tip7"></a></p>
<h3>7. Wrap everything in a single element when doing any kind of DOM insertion</h3>
<p>OK, don&#8217;t ask me why this one works (I&#8217;m sure a more experienced coder will explain).</p>
<p>In our last example we inserted 1000 list items into an unordered list using the .html() method. If we had have wrapped them in the UL tag before doing the insert and inserted the completed UL into another tag (a DIV) then we&#8217;re effectively only inserting 1 tag, not 1000, which seems to be much quicker. Like this&#8230;</p>
<pre class="brush: js">
var myList = $(&#039;.myList&#039;);
var myListItems = &#039;&amp;amp;amp;amp;lt;ul&amp;amp;amp;gt;&#039;;

for (i = 0; i &amp;amp;amp;lt; 1000; i++) {
myListItems += &#039;&amp;amp;amp;amp;lt;li&amp;amp;amp;gt;This is list item &#039; + i + &#039;&amp;amp;amp;amp;lt;/li&amp;amp;amp;gt;&#039;;
}

myListItems += &#039;&amp;amp;amp;amp;lt;/ul&amp;amp;amp;gt;&#039;;
myList.html(myListItems);
</pre>
<p>The time is now only 19 milliseconds, a massive improvement, 50x faster than our first example.</p>
<p><a name="tip8"></a></p>
<h3>8. Use IDs instead of classes wherever possible</h3>
<p>jQuery makes selecting DOM elements using classes as easy as selecting elements by ID used to be, so it&#8217;s tempting to use classes much more liberally than before. It&#8217;s still much better to select by ID though because jQuery uses the browser&#8217;s native method (getElementByID) to do this and doesn&#8217;t have to do any of it&#8217;s own DOM traversal, which is much faster. How much faster? Let&#8217;s find out.</p>
<p>I&#8217;ll use the previous example and adapt it so each LI we create has a unique class added to it. Then I&#8217;ll loop through and select each one once.</p>
<pre class="brush: js">
// Create our list
var myList = $(&#039;.myList&#039;);
var myListItems = &#039;&amp;amp;amp;amp;lt;ul&amp;amp;amp;gt;&#039;;

for (i = 0; i &amp;amp;amp;lt; 1000; i++) {
myListItems += &#039;&amp;amp;amp;amp;lt;li class=&quot;listItem&#039; + i + &#039;&quot;&amp;amp;amp;gt;This is a list item&amp;amp;amp;amp;lt;/li&amp;amp;amp;gt;&#039;;
}

myListItems += &#039;&amp;amp;amp;amp;lt;/ul&amp;amp;amp;gt;&#039;;
myList.html(myListItems);

// Select each item once
for (i = 0; i &amp;amp;amp;lt; 1000; i++) {
var selectedItem = $(&#039;.listItem&#039; + i);
}
</pre>
<p>Just as I thought my browser had hung, it finished, in 5066 milliseconds (over 5 seconds). So i modified the code to give each item an ID instead of a class and then selected them using the ID.</p>
<pre class="brush: js">
// Create our list
var myList = $(&#039;.myList&#039;);
var myListItems = &#039;&amp;amp;amp;amp;lt;ul&amp;amp;amp;gt;&#039;;

for (i = 0; i &amp;amp;amp;lt; 1000; i++) {
myListItems += &#039;&amp;amp;amp;amp;lt;li id=&quot;listItem&#039; + i + &#039;&quot;&amp;amp;amp;gt;This is a list item&amp;amp;amp;amp;lt;/li&amp;amp;amp;gt;&#039;;
}

myListItems += &#039;&amp;amp;amp;amp;lt;/ul&amp;amp;amp;gt;&#039;;
myList.html(myListItems);

// Select each item once
for (i = 0; i &amp;amp;amp;lt; 1000; i++) {
var selectedItem = $(&#039;#listItem&#039; + i);
}
</pre>
<p>This time it only took 61 milliseconds. Nearly 100x faster.</p>
<p><a name="tip9"></a></p>
<h3>9. Give your selectors a context</h3>
<p>By default, when you use a selector such as $(&#8216;.myDiv&#8217;) the whole of the DOM will be traversed, which depending on the page could be expensive.</p>
<p>The jQuery function takes a second parameter when performing a selection.</p>
<p><strong>jQuery( expression, context )</strong></p>
<p>By providing a context to the selector, you give it an element to start searching within so that it doesn&#8217;t have to traverse the whole of the DOM.</p>
<p>To demonstrate this, let&#8217;s take the first block of code from the tip above. It creates an unordered list with 1000 items, each with an individual class. It then loops through and selects each item once. You&#8217;ll remember that when selecting by class it took just over 5 seconds to select all 1000 of them using this selector.</p>
<pre class="brush: js">
var selectedItem = $(&#039;#listItem&#039; + i);
</pre>
<p>I then added a context so that it was only running the selector inside the unordered list, like this&#8230;</p>
<pre class="brush: js">
var selectedItem = $(&#039;#listItem&#039; + i, $(&#039;.myList&#039;));
</pre>
<p>It still took 3818 milliseconds because it&#8217;s still horribly inefficient, but that&#8217;s more than a 25% speed increase by making a small modification to a selector.</p>
<p><a name="tip10"></a></p>
<h3>10. Use chaining properly</h3>
<p>One of the coolest things about jQuery is it&#8217;s ability to chain method calls together. So, for example, if you want to switch the class on an element.</p>
<pre class="brush: js">
$(&#039;myDiv&#039;).removeClass(&#039;off&#039;).addClass(&#039;on&#039;);
</pre>
<p>If you&#8217;re anything like me then you probably learned that in your first 5 minutes of reading about jQuery but it goes further than that. Firstly, it still works across line breaks (because jQuery = JavaScript), which means you can write neat code like this&#8230;</p>
<pre class="brush: js">
$(&#039;#mypanel&#039;)
.find(&#039;TABLE .firstCol&#039;)
.removeClass(&#039;.firstCol&#039;)
.css(&#039;background&#039; : &#039;red&#039;)
.append(&#039;&amp;amp;amp;lt;span&amp;amp;amp;gt;This cell is now red&amp;amp;amp;lt;/span&amp;amp;amp;gt;&#039;);
</pre>
<p>Making a habit of using chaining automatically helps you to cut down on your selector use too.</p>
<p>But it goes further than that. Let&#8217;s say that you want to perform several functions on an element but one of the first functions changes the element in some way, like this&#8230;</p>
<pre class="brush: js">
$(&#039;#myTable&#039;).find(&#039;.firstColumn&#039;).css(&#039;background&#039;,&#039;red&#039;);
</pre>
<p>We&#8217;ve selected a table, drilled down to find cells with a class of &#8220;firstColumn&#8221; and coloured them in red.</p>
<p>Let&#8217;s say we now want to colour all the cells with a class of &#8220;lastColumn&#8221; blue. Because we&#8217;ve used the find() funciton we&#8217;ve filtered out all the cells that don&#8217;t have a class of &#8220;firstColumn&#8221; so we need to use the selector again to get the table element and we can&#8217;t continue chaining, right? Luckily jQuery has an end() function which actually reverts back to the previous unaltered selection so you can carry on chaining, like this&#8230;</p>
<pre class="brush: js">
$(&#039;#myTable&#039;)
.find(&#039;.firstColumn&#039;)
.css(&#039;background&#039;,&#039;red&#039;)
.end()
.find(&#039;.lastColumn&#039;)
.css(&#039;background&#039;,&#039;blue&#039;);
</pre>
<p>It&#8217;s also easier than you might think to write your own jQuery function which can chain. All you have to do is write a function which modifies an element and returns it.</p>
<pre class="brush: js">
$.fn.makeRed = function() {
return $(this).css(&#039;background&#039;, &#039;red&#039;);
}

$(&#039;#myTable&#039;).find(&#039;.firstColumn&#039;).makeRed().append(&#039;hello&#039;);
</pre>
<p>How easy was that?</p>
<p><a name="tip11"></a></p>
<h3>11. Learn to use animate properly</h3>
<p>When I first started using jQuery I loved the fact that it was easy to use the pre-defined animations like slideDown() and fadeIn() to get some really cool effects incredibly easy. It&#8217;s easy to take things further though because jQuery&#8217;s animate() method is very easy to use and very powerful. In fact, is you look at the jQuery source code you&#8217;ll see that internally those methods are just shortcuts which use the animate() function.</p>
<pre class="brush: js">
slideDown: function(speed,callback){
return this.animate({height: &quot;show&quot;}, speed, callback);
},

fadeIn: function(speed, callback){
return this.animate({opacity: &quot;show&quot;}, speed, callback);
}
</pre>
<p>The animate() method simply takes any CSS style and smoothly transitions it from one value to another. So, you can change the width, height, opacity, background-color, top, left, margin, color, font-size, anything you want.</p>
<p>This is how easy it is to animate all your menu items grow to 100 pixels high when you roll over them.</p>
<pre class="brush: js">
$(&#039;#myList li&#039;).mouseover(function() {
$(this).animate({&quot;height&quot;: 100}, &quot;slow&quot;);
});
</pre>
<p>Unlike other jQuery functions, animations are automatically queued, so if you want to run a second animation once the first is finished then just call the animate method twice, no callback necessary.</p>
<pre class="brush: js">
$(&#039;#myBox&#039;).mouseover(function() {
$(this).animate({ &quot;width&quot;: 200 }, &quot;slow&quot;);
$(this).animate({&quot;height&quot;: 200}, &quot;slow&quot;);
});
</pre>
<p>If you want the animations to happen concurrently then just put both styles in the params object of a single call, like this&#8230;</p>
<pre class="brush: js">
$(&#039;#myBox&#039;).mouseover(function() {
$(this).animate({ &quot;width&quot;: 200, &quot;height&quot;: 200 }, &quot;slow&quot;);
});
</pre>
<p>You can animate any property that&#8217;s numeric. You can also download plugins to help you animate properties that aren&#8217;t, like <a href="http://plugins.jquery.com/project/color">colors and background colors</a></p>
<p><a name="tip12"></a></p>
<h3>12. Learn about event delegation</h3>
<p>jQuery makes it easier than ever to attach events to elements in the DOM unobtrusively, which is great, but adding too many events is inefficient. Event delegation allows you to add less events to achieve the same result in many situations. The best way to illustrate this is with an example&#8230;</p>
<pre class="brush: js">
$(&#039;#myTable TD&#039;).click(function(){
$(this).css(&#039;background&#039;, &#039;red&#039;);
});
</pre>
<p>A simple function which turns cells in a table red when you click on them. Let&#8217;s say that you&#8217;ve got a grid with 10 columns and 50 rows though, that&#8217;s 500 events bound. Wouldn&#8217;t it be neater if we could just attach a single event to the table and when the table is clicked have the event handler work out which cell was clicked before turning it red?</p>
<p>Well that&#8217;s exactly what event delegation is and it&#8217;s easy to implement&#8230;</p>
<pre class="brush: js">
$(&#039;#myTable&#039;).click(function(e) {
var clicked = $(e.target);
clicked.css(&#039;background&#039;, &#039;red&#039;);
});
</pre>
<p>&#8216;e&#8217; contains information about the event, including the target element that actually received the click. All we have to do is inspect it to see which cell was actually clicked. Much neater.</p>
<p>Event delegation has another benefit. Normally, When you bind a handler to a collection of elements it gets attached to those elements and those elements only. If you add new elements to the DOM which would have been matched by the selector then they don&#8217;t have the event handler bound to them (are you following me?) then nothing will happen.</p>
<p>When using event delegation you can add as many matching elements to the DOM as you like after the event is bound and they work too.</p>
<p><a name="tip13"></a></p>
<h3>13. Use classes to store state</h3>
<p>This is the most basic way of storing information about a block of html. jQuery is great at manipulating elements based upon their classes, so if you need to store information about the state of an element then why not add an extra class to store it?</p>
<p>Here&#8217;s an example. We want to create an expanding menu. When you click the button we want the panel to slideDown() if it&#8217;s currently closed, or slideUp() if it&#8217;s currently open. We&#8217;ll start with the HTML</p>
<pre class="brush: html">
&amp;amp;amp;amp;lt;div class=&quot;menuItem expanded&quot;&amp;amp;amp;gt;
&amp;amp;amp;lt;div class=&quot;button&quot;&amp;amp;amp;gt;
click me
&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;div class=&quot;panel&quot;&amp;amp;amp;gt;
&amp;amp;amp;amp;lt;ul&amp;amp;amp;gt;
&amp;amp;amp;amp;lt;li&amp;amp;amp;gt;Menu item 1&amp;amp;amp;amp;lt;/li&amp;amp;amp;gt;
&amp;amp;amp;amp;lt;li&amp;amp;amp;gt;Menu item 2&amp;amp;amp;amp;lt;/li&amp;amp;amp;gt;
&amp;amp;amp;amp;lt;li&amp;amp;amp;gt;Menu item 3&amp;amp;amp;amp;lt;/li&amp;amp;amp;gt;
&amp;amp;amp;amp;lt;/ul&amp;amp;amp;gt;
&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;/div&amp;amp;amp;gt;
</pre>
<p>Very simple! We&#8217;ve just added an extra class to the wrapper div which serves no other purpose other than to tell us the state of the item. So all we need is a click event handler which performs slideUp() or slideDown() on the corresponding panel when the button is clicked.</p>
<pre class="brush: js">
$(&#039;.button&#039;).click(function() {

var menuItem = $(this).parent();
var panel = menuItem.find(&#039;.panel&#039;);

if (menuItem.hasClass(&quot;expanded&quot;)) {
menuItem.removeClass(&#039;expanded&#039;).addClass(&#039;collapsed&#039;);
panel.slideUp();
}
else if (menuItem.hasClass(&quot;collapsed&quot;)) {
menuItem.removeClass(&#039;collapsed&#039;).addClass(&#039;expanded&#039;);
panel.slideDown();
}
});
</pre>
<p>That&#8217;s a very simple example, but you can add extra classes for storing all sorts of information about an element or HTML fragment.</p>
<p>However, in all but simple cases it&#8217;s probably better to use the next tip.</p>
<p><a name="tip14"></a></p>
<h3>14. Even better, use jQuery&#8217;s internal data() method to store state</h3>
<p>It&#8217;s not very well documented for some reason but jQuery has an internal data() method which can be used to store information in key/value pairs against any DOM element. Storing a piece of data is as simple as this&#8230;</p>
<pre class="brush: js">
$(&#039;#myDiv&#039;).data(&#039;currentState&#039;, &#039;off&#039;);
</pre>
<p>We can amend the example from the previous tip. We&#8217;ll use the same HTML (with the &#8220;expanded&#8221; class removed) and use the data() function instead.</p>
<pre class="brush: js">
$(&#039;.button&#039;).click(function() {

var menuItem = $(this).parent();
var panel = menuItem.find(&#039;.panel&#039;);

if (menuItem.data(&#039;collapsed&#039;)) {
menuItem.data(&#039;collapsed&#039;, false);
panel.slideDown();
}
else {
menuItem.data(&#039;collapsed&#039;, true);
panel.slideUp();
}
});
</pre>
<p>I&#8217;m sure you&#8217;ll agree this is much neater. For more information about data() and removeData(), see this page&#8230;</p>
<p><a href="http://docs.jquery.com/Internals">jQuery internals</a></p>
<p><a name="tip15"></a></p>
<h3>15. Write your own selectors</h3>
<p>jQuery has loads of built-in selectors for selecting elements by ID, class, tag, attribute and many more. But what do you do when you need to select elements based upon something else and jQuery doesn&#8217;t have a selector?</p>
<p>Well, one answer would be to add classes to the elements from the start and use those to select them, but it turns out that it&#8217;s not hard to extend jQuery to add new selectors.</p>
<p>The best way to demonstrate is with an example.</p>
<pre class="brush: js">
$.extend($.expr[&#039;:&#039;], {
over100pixels: function(a) {
return $(a).height() &amp;amp;amp;gt; 100;
}
});

$(&#039;.box:over100pixels&#039;).click(function() {
alert(&#039;The element you clicked is over 100 pixels high&#039;);
});
</pre>
<p>The first block of code creates a custom selector which finds any element that is more than 100 pixels tall. The second block just uses it to add a click handler to all those elements.</p>
<p>I won&#8217;t go into any more detail here but you can imagine how powerful this is and if you search google for &#8220;custom jquery selector&#8221; you&#8217;ll find loads of great examples.</p>
<p><a name="tip16"></a></p>
<h3>16. Streamline your HTML and modify it once the page has loaded</h3>
<p>The title might not make a lot of sense but this tip can potentially neaten up your code, reduce the weight and download time of your page and help your SEO. Take the following HTML for example&#8230;</p>
<pre class="brush: html">
&amp;amp;amp;amp;lt;div class=&quot;fieldOuter&quot;&amp;amp;amp;gt;
&amp;amp;amp;lt;div class=&quot;inner&quot;&amp;amp;amp;gt;
&amp;amp;amp;lt;div class=&quot;field&quot;&amp;amp;amp;gt;This is field number 1&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;amp;lt;div class=&quot;errorBar&quot;&amp;amp;amp;gt;
&amp;amp;amp;amp;lt;div class=&quot;icon&quot;&amp;amp;amp;gt;&amp;amp;amp;amp;lt;img src=&quot;icon.png&quot; alt=&quot;icon&quot; /&amp;amp;amp;gt;&amp;amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;div class=&quot;message&quot;&amp;amp;amp;gt;&amp;amp;amp;lt;span&amp;amp;amp;gt;This is an error message&amp;amp;amp;lt;/span&amp;amp;amp;gt;&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;amp;lt;div class=&quot;fieldOuter&quot;&amp;amp;amp;gt;
&amp;amp;amp;lt;div class=&quot;inner&quot;&amp;amp;amp;gt;
&amp;amp;amp;lt;div class=&quot;field&quot;&amp;amp;amp;gt;This is field number 2&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;amp;lt;div class=&quot;errorBar&quot;&amp;amp;amp;gt;
&amp;amp;amp;amp;lt;div class=&quot;icon&quot;&amp;amp;amp;gt;&amp;amp;amp;amp;lt;img src=&quot;icon.png&quot; alt=&quot;icon&quot; /&amp;amp;amp;gt;&amp;amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;div class=&quot;message&quot;&amp;amp;amp;gt;&amp;amp;amp;lt;span&amp;amp;amp;gt;This is an error message&amp;amp;amp;lt;/span&amp;amp;amp;gt;&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;/div&amp;amp;amp;gt;
</pre>
<p>That&#8217;s an example of how a form might be marked up, modified slightly for illustrative purposes. I&#8217;m sure you&#8217;ll agree it&#8217;s pretty ugly and if you had a long form you&#8217;d end up with a fairly long ugly page. It&#8217;s be nicer if you could just put this in your HTML.</p>
<pre class="brush: html">
&amp;amp;amp;lt;div class=&quot;field&quot;&amp;amp;amp;gt;This is field 1&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;div class=&quot;field&quot;&amp;amp;amp;gt;This is field 2&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;div class=&quot;field&quot;&amp;amp;amp;gt;This is field 3&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;div class=&quot;field&quot;&amp;amp;amp;gt;This is field 4&amp;amp;amp;lt;/div&amp;amp;amp;gt;
&amp;amp;amp;lt;div class=&quot;field&quot;&amp;amp;amp;gt;This is field 5&amp;amp;amp;lt;/div&amp;amp;amp;gt;
</pre>
<p>All you have to do is a bit of jQuery manipulation to add all the ugly HTML back in. Like this&#8230;</p>
<pre class="brush: js">
$(document).ready(function() {
$(&#039;.field&#039;).before(&#039;&amp;amp;amp;amp;lt;div class=&quot;fieldOuter&quot;&amp;amp;amp;gt;&amp;amp;amp;amp;lt;div class=&quot;inner&quot;&amp;amp;amp;gt;&#039;);
$(&#039;.field&#039;).after(&#039;&amp;amp;amp;amp;lt;/div&amp;amp;amp;gt;&amp;amp;amp;amp;lt;div class=&quot;errorBar&quot;&amp;amp;amp;gt;&amp;amp;amp;amp;lt;div class=&quot;icon&quot;&amp;amp;amp;gt;
&amp;amp;amp;amp;lt;img src=&quot;icon.png&quot; alt=&quot;icon&quot; /&amp;amp;amp;gt;&amp;amp;amp;amp;lt;/div&amp;amp;amp;gt;&amp;amp;amp;amp;lt;div class=&quot;message&quot;&amp;amp;amp;gt;
&amp;amp;amp;lt;span&amp;amp;amp;gt;This is an error message&amp;amp;amp;lt;/span&amp;amp;amp;gt;&amp;amp;amp;lt;/div&amp;amp;amp;gt;&amp;amp;amp;lt;/div&amp;amp;amp;gt;&amp;amp;amp;lt;/div&amp;amp;amp;gt;&#039;);
});
</pre>
<p>It&#8217;s not always advisable to do this, you&#8217;ll get a bit of a flash as the page loads, but in certain situations where you&#8217;ve got a lot of repeated HTML it can really reduce your page weight and the SEO benefits of reducing all your repeated extraneous markup should be obvious.</p>
<p><a name="tip17"></a></p>
<h3>17. Lazy load content for speed and SEO benefits</h3>
<p>Another way to speed up your page loads and neaten up the HTML that search spiders see is to lazy load whole chunks of it using an AJAX request after the rest of the page has loaded. The user can get browsing right away and spiders only see the content you want them to index.</p>
<p>We&#8217;ve used this technique on our own site. Those purple buttons at the top of the page drop down 3 forms, directions and a google map, which was doubling the size of our pages. So, we just put all that HTML in a static page and use the load() function to load it in once the DOM was ready. Like this&#8230;</p>
<pre class="brush: js">
$(&#039;#forms&#039;).load(&#039;content/headerForms.html&#039;, function() {
// Code here runs once the content has loaded
// Put all your event handlers etc. here.
});
</pre>
<p>I wouldn&#8217;t use this everywhere. You have to consider the trade offs here. You&#8217;re making extra requests to the server and portions of your page might not be available to the user right away, but used correctly it can be a great optimization technique.</p>
<p><a name="tip18"></a></p>
<h3>18. Use jQuery&#8217;s utility functions</h3>
<p>jQuery isn&#8217;t just about flash effects. The creator has exposed some really useful methods which fill a few gaps in JavaScript&#8217;s repertoire.</p>
<p><a href="http://docs.jquery.com/Utilities">http://docs.jquery.com/Utilities</a></p>
<p>In particular, browser support for certain common array functions is patchy (IE7 doesn&#8217;t even have an indexOf() method!). Jquery has methods for iterating, filtering, cloning, merging and removing duplicates from Arrays.</p>
<p>Other common functions that are difficult in Javascript include getting the selected item in a drop down list. In plain old JavaScript you&#8217;d have to get the &amp;lt;select&gt; element using getElementByID, get the child elements as an array and iterate through them checking whether each one was selected or not. jQuery makes it easy&#8230;</p>
<pre class="brush: js">
$(&#039;#selectList&#039;).val();
</pre>
<p>It&#8217;s worth spending some time looking through the jQuery documentation on the main site and having a nose around some of the lesser known functions.</p>
<p><a name="tip19"></a></p>
<h3>19. Use noconflict to rename the jquery object when using other frameworks</h3>
<p>Most javascript frameworks make use of the $ symbol as a shorthand and this can cause clashes when trying to use more than one framework on the same page. Luckily there&#8217;s a simple solution. The .noconflict() function gives control of the $ back and allows you to set your own variable name, like this&#8230;</p>
<pre class="brush: js">
var $j = jQuery.noConflict();
$j(&#039;#myDiv&#039;).hide();
</pre>
<p><a name="tip20"></a></p>
<h3>20. How to tell when images have loaded</h3>
<p>This is another one of those problems that doesn&#8217;t seem to be as well documented as it should be (not when I went looking anyway) and it&#8217;s a fairly common requirement when building photo galleries, carousels etc,  but it&#8217;s fairly easy.</p>
<p>All you have to do is use the .load() method on an IMG element and put a callback function in it. The following example changes the &#8220;src&#8221; attribute of an image tag to load a new image and attaches a simple load function.</p>
<pre class="brush: js">
$(&#039;#myImage&#039;).attr(&#039;src&#039;, &#039;image.jpg&#039;).load(function() {
alert(&#039;Image Loaded&#039;);
});
</pre>
<p>You should find that the alert is called as soon as the image is loaded.</p>
<p><a name="tip21"></a></p>
<h3>21. Always use the latest version</h3>
<p>jQuery is constantly improving and John Resig, it&#8217;s creator, always seems to be in search of ways to improve performance.</p>
<p>jQuery is currently on version 1.2.6 but John has already revealed that he&#8217;s working on a new selector engine called <a href="http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine">Sizzle</a>, which may apparently improve selector speeds in Firefox by up to 4x. So, it pays to keep up to date.</p>
<p><a name="tip22"></a></p>
<h3>22. How to check if an element exists</h3>
<p>You don&#8217;t need to check if an element exists on the page before you manipulate it because jQuery will will simply do nothing if you try to select something and it isn&#8217;t in the DOM. But when you do need to check if anything has been selected, or how many items have been selected you can use the length property.</p>
<pre class="brush: js">
if ($(&#039;#myDiv).length) {
// your code
}
</pre>
<p>Simple, but not obvious.</p>
<p><a name="tip23"></a></p>
<h3>23. Add a JS class to your HTML attribute</h3>
<p>I learned this tip from Karl Swedberg whose <a href="http://www.amazon.co.uk/Learning-JQuery-Interaction-Development-Javascript/dp/1847192505/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1229284831&amp;sr=8-1">excellent</a> <a href="http://www.amazon.co.uk/JQuery-Reference-Guide-Karl-Swedberg/dp/1847193811/ref=sr_1_3?ie=UTF8&amp;s=books&amp;qid=1229284831&amp;sr=8-3">books</a> I used to learn jQuery.</p>
<p>He recently left a comment on one of my previous articles about this technique and the basics are as follows&#8230;</p>
<p>Firstly, as soon as jQuery has loaded you use it to add a &#8220;JS&#8221; class to your HTML tag.</p>
<pre class="brush: js">
$(&#039;HTML&#039;).addClass(&#039;JS&#039;);
</pre>
<p>Because that only happens when javascript is enabled you can use it to add CSS styles which only work if the user has JavaScript switched on, like this&#8230;</p>
<pre class="css" title="code">.JS #myDiv{display:none;}
[/js]

So, what this means is that we can hide content when JavaScript is switched on and then use jQuery to show it when necessary (e.g. by collapsing some panels and expanding them when the user clicks on them), while those with JavaScript off (and search engine spiders) see all of the content as it's not hidden. I'll be using this one a lot in the future.

To read his full article <a href="http://www.learningjquery.com/2008/10/1-awesome-way-to-avoid-the-not-so-excellent-flash-of-amazing-unstyled-content">click here</a>.

<a name="tip24"></a>
<h3>24. Return 'false' to prevent default behaviour</h3>

This should be an obvious one but maybe not.  if you have a habit of doing this...
<pre class="brush: html">
&amp;amp;amp;amp;lt;a href=&quot;#&quot; class=&quot;popup&quot;&amp;amp;amp;gt;Click me!&amp;amp;amp;amp;lt;/a&amp;amp;amp;gt;
[/js]
&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;... and then attaching an event handler like this...&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;[js]
$(&#039;popup&#039;).click(function(){
    // Launch popup code
});
</pre>
<p>... it'll probably work fine until you use it on a long page, at which point you'll notice that the # is causing it to jump to the top of the page when your click event is triggered.</p>
<p>All you have to do to prevent this default behaviour, or indeed any default behaviour on any event handler is to add "return false;" to your handler, like this...</p>
<pre class="brush: js">
$(&#039;popup&#039;).click(function(){
    // Launch popup code
    return false;
});
</pre>
<p><a name="tip25"></a></p>
<h3>25. Shorthand for the ready event</h3>
<p>A small tip this one but you can save a few characters by using shorthand for the $(document).ready function.</p>
<p>Instead of this...</p>
<pre class="brush: js">
$(document).ready(function (){
    // your code
});
</pre>
<p>You can do this...</p>
<pre class="brush: js">
$(function (){
    // your code
});
</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://max.jsrhost.com/2009/04/20/more-than-25-excellent-tips-to-improve-jquery/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>New Domain</title>
		<link>http://max.jsrhost.com/2009/01/05/new-domain/</link>
		<comments>http://max.jsrhost.com/2009/01/05/new-domain/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 00:09:40 +0000</pubDate>
		<dc:creator>MaX</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/maxjsrho/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[Uncategorized]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://maxblog.me/?p=140</guid>
		<description><![CDATA[Today, I have purchased a new domain for my blog. I think this one is much easier than the sub-domain. As you can see, the new domain is : maxblog.me all files and demos will run normally. and will not get affected.]]></description>
			<content:encoded><![CDATA[<p>Today, I have purchased a new domain for my blog. I think this one is much easier than the sub-domain. As you can see, the new domain is : maxblog.me</p>
<p>all files and demos will run normally. and will not get affected.</p>
]]></content:encoded>
			<wfw:commentRss>http://max.jsrhost.com/2009/01/05/new-domain/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ajaxify v2.0 Knocked Our Door</title>
		<link>http://max.jsrhost.com/2008/12/12/ajaxify-v20-knocked-our-door/</link>
		<comments>http://max.jsrhost.com/2008/12/12/ajaxify-v20-knocked-our-door/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 23:58:27 +0000</pubDate>
		<dc:creator>MaX</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ajaxify]]></category>
		<category><![CDATA[Version 2]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://max.jsrhost.com/?p=118</guid>
		<description><![CDATA[When I released ajaxify v1.0 I didn&#8217;t expect that huge demand for the plugin. I thought its just a crap of code. but then, I remembered how it was difficult to start programming for me. So I decided to complete what I have started. I have created a special homepage for the plugin. Added new [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="float:right" src="http://max.jsrhost.com/ajaxify/images/cover.png" alt="ajaxify v2.00" width="400" height="300" />When I released ajaxify v1.0 I didn&#8217;t expect that huge demand for the plugin. I thought its just a crap of code. but then, I remembered how it was difficult to start programming for me. So I decided to complete what I have started. I have created a special <a href="http://max.jsrhost.com/ajaxify/">homepage for the plugin</a>. Added new cool features. fixed v1.0 bugs.  After hours of hard work. v2.0 released today. I hope you like it. And as always, any help, bug report, suggestion,  confession&#8230;. don&#8217;t be shy.</p>
<p>(Please, dont post questions here about ajaxify. post it in the appropriate support page )</p>
<p>MaX,</p>
<p>Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.</p>
]]></content:encoded>
			<wfw:commentRss>http://max.jsrhost.com/2008/12/12/ajaxify-v20-knocked-our-door/feed/</wfw:commentRss>
		<slash:comments>61</slash:comments>
		</item>
		<item>
		<title>Ajaxify &#8211; Support v2.0</title>
		<link>http://max.jsrhost.com/2008/12/12/ajaxify-support-v20/</link>
		<comments>http://max.jsrhost.com/2008/12/12/ajaxify-support-v20/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 23:39:17 +0000</pubDate>
		<dc:creator>MaX</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/maxjsrho/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[jQuery]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://max.jsrhost.com/?p=115</guid>
		<description><![CDATA[Any Comments, bugs , feature request about Ajaxify v2.0, please post it here. For advanced paid support or special requests. Contact me through the contact form. Known issues: Stop ajaxify excuting based on onStart function  return. Fix false warning &#8220;warning: target “#Ajaxifytemp” couldn`t be found&#8221; Fix back button on first ajaxify call. Feature requests: Loading [...]]]></description>
			<content:encoded><![CDATA[<h4 style="text-align: center;">Any Comments, bugs , feature request about Ajaxify v2.0, please post it here.</h4>
<h3><span style="color: #99cc00;"> <strong>For advanced paid support or special requests. Contact me through the <a href="http://maxblog.me/contact/">contact form</a>.</strong></span></h3>
<p><span style="color: #99cc00;"><strong> </strong></span></p>
<h4>Known issues:</h4>
<ul>
<li> <span style="color: #d0352e;">Stop ajaxify excuting based on onStart function  return.<img class="alignright size-full wp-image-168" title="support" src="http://maxblog.me/wp-content/uploads/2008/12/support.jpg" alt="support" width="192" height="192" /></span></li>
<li><span style="color: #d0352e;">Fix false </span><span style="color: #d0352e;">warning </span><span style="color: #d0352e;">&#8220;warning</span><span style="color: #d0352e;">: target “#Ajaxifytemp” couldn`t be found&#8221;</span></li>
<li><span style="color: #d0352e;">Fix back button on first ajaxify call.</span></li>
</ul>
<h4>Feature requests:</h4>
<ul>
<li> <span style="color: #339966;">Loading Images via ajaxify.</span></li>
<li><span style="color: #339966;">Encode non safe characters in url&#8217;s before sending the request.</span></li>
<li><span style="color: #339966;">Change the page title based on the loaded content.</span></li>
</ul>
<h4><span style="color: #464646;"><strong>For advanced paid support or special requests. Contact me through the <a href="http://maxblog.me/contact/">contact form</a>.</strong></span></h4>
<p><span style="color: #464646;"><strong>__________________________________________________________________________</strong></span></p>
<p><span style="color: #464646;"><strong> </strong></span></p>
<h4><span style="color: #464646;"><strong>How to make ajaxify compatible with jquery v1.3.0 and higher?.</strong></span></h4>
<ol>
<li><span style="color: #464646;"><strong> </strong></span><span style="color: #464646;">Open jquery.ajaxify.js with your preferred editor.</span></li>
<li><span style="color: #464646;">Go to line 58. You will see</span><span style="color: #464646;"><strong> </strong></span><span style="color: #808080;"><strong>var ver = jQuery.fn.jquery.split(&#8216;.&#8217;);</strong></span></li>
<li><span style="color: #000000;">Mark it, and go down until you reach line 62. So the full text will be:</span>
<pre class="brush: js">var ver = jQuery.fn.jquery.split(&#039;.&#039;);
if(ver[0] &lt; 1 || ver[1] &lt; 2 || ver[2] &lt; 6){
jQuery.ajaxifylog(&#039;Error: Your jQuery version is old. Version 1.2.6 or newer is required.&#039;);
return false;
}</pre>
</li>
<li>Comment it or delete it. its your choice.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://max.jsrhost.com/2008/12/12/ajaxify-support-v20/feed/</wfw:commentRss>
		<slash:comments>415</slash:comments>
		</item>
		<item>
		<title>Ajaxify &#8211; Support v1.0</title>
		<link>http://max.jsrhost.com/2008/10/03/ajaxify-support/</link>
		<comments>http://max.jsrhost.com/2008/10/03/ajaxify-support/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 10:24:03 +0000</pubDate>
		<dc:creator>MaX</dc:creator>
				<category><![CDATA[jQuery]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://max.jsrhost.com/?p=67</guid>
		<description><![CDATA[Any Comments, bugs , feature request about Ajaxify, please post it here. Known issues: links that has this form &#60;a href=&#8221;#&#8221;&#62; doesn&#8217;t load. See solution live query and load hash enabled produce infinte loops. Feature requests: These features will be implemented in the next versions. Rebinding ajaxify automatically to the new created elements from the [...]]]></description>
			<content:encoded><![CDATA[<h4 style="text-align: center;">Any Comments, bugs , feature request about Ajaxify, please post it here.</h4>
<h3>Known issues:</h3>
<ul>
<li><span style="color: #000000;"> links that has this form &lt;a href=&#8221;#&#8221;&gt; doesn&#8217;t load. <a href="http://max.jsrhost.com/2008/10/03/ajaxify-support/#comment-14">See solution</a></span></li>
<li><span style="color: #000000;">live query and load hash enabled produce infinte loops.</span></li>
</ul>
<h3>Feature requests:</h3>
<p>These features will be implemented in the next versions.</p>
<ul>
<li>Rebinding ajaxify automatically to the new created elements from the loaded page.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://max.jsrhost.com/2008/10/03/ajaxify-support/feed/</wfw:commentRss>
		<slash:comments>114</slash:comments>
		</item>
		<item>
		<title>Ajaxify &#8211; First release</title>
		<link>http://max.jsrhost.com/2008/10/03/ajaxify-first-release/</link>
		<comments>http://max.jsrhost.com/2008/10/03/ajaxify-first-release/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 09:25:54 +0000</pubDate>
		<dc:creator>MaX</dc:creator>
				<category><![CDATA[jQuery]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://max.jsrhost.com/?p=63</guid>
		<description><![CDATA[Today, I would like to annonce that my first jQuery plugin &#8220;Ajaxify&#8221; is released. Ajaxify can converts links in a web page into ajax requests. with this plugin you can build your complex ajax website with one line of code. Main features: Ajax GET and POST requests. 4 events support. Bookmarking support. Partial load from [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I would like to annonce that my first jQuery plugin &#8220;Ajaxify&#8221; is released.</p>
<p><strong>Ajaxify</strong> can converts links in a web page into ajax requests. with this plugin you can build your complex ajax website with one line of code.</p>
<p><strong>Main features:</strong></p>
<p>Ajax GET and POST requests.<br />
4 events support.<br />
Bookmarking support.<br />
Partial load from the output.</p>
<p>check <a href="http://max.jsrhost.com/ajaxify-jquery-plugin/">ajaxify page</a> for more details</p>
]]></content:encoded>
			<wfw:commentRss>http://max.jsrhost.com/2008/10/03/ajaxify-first-release/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

