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

<channel>
	<title>15 Days Of jQuery</title>
	<atom:link href="http://15daysofjquery.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://15daysofjquery.com</link>
	<description>Examples and tutorials to help you learn JQuery</description>
	<pubDate>Thu, 16 Oct 2008 14:20:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>How to Create AJAX Web Applications Using jQuery</title>
		<link>http://15daysofjquery.com/how-to-create-ajax-web-applications-using-jquery/41/</link>
		<comments>http://15daysofjquery.com/how-to-create-ajax-web-applications-using-jquery/41/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 17:40:53 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/?p=41</guid>
		<description><![CDATA[The launch of the CD-ROM: &#8220;How to Create AJAX Web Applications (using jQuery)&#8221; was a hit and I want to thank everyone that ordered. You got a nice $10 price break, and shipping paid for by me.

The CD-ROM is just $39 and I&#8217;m still paying the shipping costs. And you get instant access to the [...]]]></description>
			<content:encoded><![CDATA[<p>The launch of the CD-ROM: &#8220;How to Create AJAX Web Applications (using jQuery)&#8221; was a hit and I want to thank everyone that ordered. You got a nice $10 price break, and shipping paid for by me.</p>
<p><a href="http://www.jackborn.com/members/paypal_order/index/5/4539"><img src="https://www.jackborn.com/i/heroShots/15daysajax/cdHero1.jpg" alt="" border="0" style="float:right;" /></a></p>
<p>The CD-ROM is just $39 and I&#8217;m still paying the shipping costs. And you get instant access to the videos online.</p>
<ul>
<li>CD ROM <em>AND</em> instant online videos</li>
<li>No shipping cost - I pay that for you</li>
<li>2 and a half hours of video instruction</li>
<li>14 demos</li>
<li>Code and data for demos included</li>
<li>Links to resources</li>
</ul>
<h3>How to Pay</h3>
<p>You can order with <a href="http://www.jackborn.com/members/paypal_order/index/5/4539">PayPal</a> or a <a href="https://www.jackborn.com/members/order/product/5/4539">major credit card</a>.</p>
<p>After your purchase, you&#8217;ll get an email from me with login details for instant access to the videos. If you&#8217;re in the United States, you&#8217;ll get your CD in the mail in about 5-7 business days. International orders take a bit longer.</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/how-to-create-ajax-web-applications-using-jquery/41/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Updates to the jQuery Tutorials</title>
		<link>http://15daysofjquery.com/updates-to-the-jquery-tutorials/42/</link>
		<comments>http://15daysofjquery.com/updates-to-the-jquery-tutorials/42/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 17:40:54 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/?p=42</guid>
		<description><![CDATA[After a long hiatus, I&#8217;m going to dive back in and create a new round of tutorials for everyone that wants to learn jQuery.
My plans include a lot of video demonstrations to help folks see exactly how to take advantage of everything that jQuery has to offer. I&#8217;m even toying with the idea of doing [...]]]></description>
			<content:encoded><![CDATA[<p>After a long hiatus, I&#8217;m going to dive back in and create a new round of tutorials for everyone that wants to learn jQuery.</p>
<p>My plans include a lot of video demonstrations to help folks see exactly how to take advantage of everything that jQuery has to offer. I&#8217;m even toying with the idea of doing some live events so I can get feedback and participation&#8230; we&#8217;ll see.</p>
<p>In the past year, the number of plugins for jQuery has exploded. I&#8217;ll cover several of these in great detail and even release at least one of my own plugins.</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/updates-to-the-jquery-tutorials/42/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery 1.1 Makes a Big Splash</title>
		<link>http://15daysofjquery.com/jquery-11-makes-a-big-splash/35/</link>
		<comments>http://15daysofjquery.com/jquery-11-makes-a-big-splash/35/#comments</comments>
		<pubDate>Tue, 16 Jan 2007 03:57:32 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/jquery-11-makes-a-big-splash/35/</guid>
		<description><![CDATA[I take the day off and hit the golf course only to come back and find out that John Resig and gang have launched jQuery 1.1 with a bunch of new improvements, reworked site design for the official jQuery site, and some really sharp jQuery plugins.
Just the Facts
John goes into much more detail on the [...]]]></description>
			<content:encoded><![CDATA[<p>I take the day off and hit the golf course only to come back and find out that John Resig and gang have launched <a href="http://jquery.com/blog/2007/01/14/jquery-birthday-11-new-site-new-docs/">jQuery 1.1</a> with a bunch of new improvements, reworked site design for the official jQuery site, and some really sharp <a href="http://interface.eyecon.ro/">jQuery plugins</a>.</p>
<h3>Just the Facts</h3>
<p>John goes into much more detail on the main jQuery blog, but here is what you need to know, in a nutshell:</p>
<ul>
<li>Huge speed improvements</li>
<li>Much better <a href="http://docs.jquery.com/Main_Page">documentation for jQuery</a></li>
<li>There is a <a href="http://jquery.com/dev/svn/trunk/plugins/compat-1.0/jquery.compat-1.0.js?format=txt">jQuery compatibility plugin</a> if your fav plugin doesn&#8217;t jive with version 1.1</li>
<li><a href="http://jquery.com/src/jquery-1.1.js">jQuery source code</a></li>
<li><a href="http://jquery.com/src/jquery-1.1.pack.js">jQuery compressed</a></li>
</ul>
<h3>Other Interesting News About jQuery</h3>
<p>On a lighter note:</p>
<ul>
<li>jQuery is one year old (as of yesterday)</li>
<li>A book on jQuery is in the works, and has been for some time. Look for release in late spring or early summer.</li>
</ul>
<h3>Bugs in jQuery 1.1a Squashed</h3>
<p>I mentioned in a recent post that I had a few fantastic plugins on the way. I was just about to pull the trigger when 1.1a was announced. Turns out that there were a few bugs that prevented my plugin from working like it should, so I held off.</p>
<p>With the release of 1.1b those bugs were gone and my plugins were working again.</p>
<p>So, off I run to do some tests with jQuery 1.1 to see if all is well.</p>
<p>Make sure you&#8217;re on my subscription list, whether RSS, or email it doesn&#8217;t matter.</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/jquery-11-makes-a-big-splash/35/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Big Speed Increases with jQuery 1.1a</title>
		<link>http://15daysofjquery.com/big-speed-increases-with-jquery-11a/34/</link>
		<comments>http://15daysofjquery.com/big-speed-increases-with-jquery-11a/34/#comments</comments>
		<pubDate>Mon, 08 Jan 2007 19:28:09 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/big-speed-increases-with-jquery-11a/34/</guid>
		<description><![CDATA[On the same day I&#8217;m about to announce a fantastic new plugin, John Resig announces the release of jQuery 1.1 and promises huge speed increases: 
&#34; Weâ€™ll be releasing some final numbers soon, but weâ€™re looking at 4x-10x speed improvements - with some selectors seeing a 30x speed bump.&#34; 
I&#8217;m going to test my plugin [...]]]></description>
			<content:encoded><![CDATA[<p>On the same day I&#8217;m about to announce a fantastic new plugin, <a href="http://jquery.com/blog/2006/12/27/the-path-to-11/">John Resig announces the release of jQuery 1.1</a> and promises huge speed increases: </p>
<blockquote><p>&quot; Weâ€™ll be releasing some final numbers soon, but weâ€™re looking at 4x-10x speed improvements - with some selectors seeing a 30x speed bump.&quot; </p></blockquote>
<p>I&#8217;m going to test my plugin with the latest version of jQuery, so be sure you&#8217;re subscribed to my RSS feed for the upcoming announcement.</p>
<h3>Cheat sheet</h3>
<p>Here is some vital info on key changes found in this release:</p>
<table >
<tr>
<th>Old Way (1.0.x)</th>
<th>New Way (1.1)</th>
</tr>
<tr>
<td>.ancestors()</td>
<td>.parents()</td>
</tr>
<tr>
<td>.width()</td>
<td>.css(&#8221;width&#8221;)</td>
</tr>
<tr>
<td>.height()</td>
<td>.css(&#8221;height&#8221;)</td>
</tr>
<tr>
<td>.top()</td>
<td>.css(&#8221;top&#8221;)</td>
</tr>
<tr>
<td>.left()</td>
<td>.css(&#8221;left&#8221;)</td>
</tr>
<tr>
<td>.position()</td>
<td>.css(&#8221;position&#8221;)</td>
</tr>
<tr>
<td>.float()</td>
<td>.css(&#8221;float&#8221;)</td>
</tr>
<tr>
<td>.overflow()</td>
<td>.css(&#8221;overflow&#8221;)</td>
</tr>
<tr>
<td>.color()</td>
<td>.css(&#8221;color&#8221;)</td>
</tr>
<tr>
<td>.background()</td>
<td>.css(&#8221;background&#8221;)</td>
</tr>
<tr>
<td>.id()</td>
<td>.attr(&#8221;id&#8221;)</td>
</tr>
<tr>
<td>.title()</td>
<td>.attr(&#8221;title&#8221;)</td>
</tr>
<tr>
<td>.name()</td>
<td>.attr(&#8221;name&#8221;)</td>
</tr>
<tr>
<td>.href()</td>
<td>.attr(&#8221;href&#8221;)</td>
</tr>
<tr>
<td>.src()</td>
<td>.attr(&#8221;src&#8221;)</td>
</tr>
<tr>
<td>.rel()</td>
<td>.attr(&#8221;rel&#8221;)</td>
</tr>
<tr>
<td>.oneblur(fn)</td>
<td>.one(&#8221;blur&#8221;,fn)</td>
</tr>
<tr>
<td>.onefocus(fn)</td>
<td>.one(&#8221;focus&#8221;,fn)</td>
</tr>
<tr>
<td>.oneload(fn)</td>
<td>.one(&#8221;load&#8221;,fn)</td>
</tr>
<tr>
<td>.oneresize(fn)</td>
<td>.one(&#8221;resize&#8221;,fn)</td>
</tr>
<tr>
<td>.onescroll(fn)</td>
<td>.one(&#8221;scroll&#8221;,fn)</td>
</tr>
<tr>
<td>.oneunload(fn)</td>
<td>.one(&#8221;unload&#8221;,fn)</td>
</tr>
<tr>
<td>.oneclick(fn)</td>
<td>.one(&#8221;click&#8221;,fn)</td>
</tr>
<tr>
<td>.onedblclick(fn)</td>
<td>.one(&#8221;dblclick&#8221;,fn)</td>
</tr>
<tr>
<td>.onemousedown(fn)</td>
<td>.one(&#8221;mousedown&#8221;,fn)</td>
</tr>
<tr>
<td>.onemouseup(fn)</td>
<td>.one(&#8221;mouseup&#8221;,fn)</td>
</tr>
<tr>
<td>.onemousemove(fn)</td>
<td>.one(&#8221;mousemove&#8221;,fn)</td>
</tr>
<tr>
<td>.onemouseover(fn)</td>
<td>.one(&#8221;mouseover&#8221;,fn)</td>
</tr>
<tr>
<td>.onemouseout(fn)</td>
<td>.one(&#8221;mouseout&#8221;,fn)</td>
</tr>
<tr>
<td>.onechange(fn)</td>
<td>.one(&#8221;change&#8221;,fn)</td>
</tr>
<tr>
<td>.onereset(fn)</td>
<td>.one(&#8221;reset&#8221;,fn)</td>
</tr>
<tr>
<td>.oneselect(fn)</td>
<td>.one(&#8221;select&#8221;,fn)</td>
</tr>
<tr>
<td>.onesubmit(fn)</td>
<td>.one(&#8221;submit&#8221;,fn)</td>
</tr>
<tr>
<td>.onekeydown(fn)</td>
<td>.one(&#8221;keydown&#8221;,fn)</td>
</tr>
<tr>
<td>.onekeypress(fn)</td>
<td>.one(&#8221;keypress&#8221;,fn)</td>
</tr>
<tr>
<td>.onekeyup(fn)</td>
<td>.one(&#8221;keyup&#8221;,fn)</td>
</tr>
<tr>
<td>.oneerror(fn)</td>
<td>.one(&#8221;error&#8221;,fn)</td>
</tr>
<tr>
<td>.unblur(fn)</td>
<td>.unbind(&#8221;blur&#8221;,fn)</td>
</tr>
<tr>
<td>.unfocus(fn)</td>
<td>.unbind(&#8221;focus&#8221;,fn)</td>
</tr>
<tr>
<td>.unload(fn)</td>
<td>.unbind(&#8221;load&#8221;,fn)</td>
</tr>
<tr>
<td>.unresize(fn)</td>
<td>.unbind(&#8221;resize&#8221;,fn)</td>
</tr>
<tr>
<td>.unscroll(fn)</td>
<td>.unbind(&#8221;scroll&#8221;,fn)</td>
</tr>
<tr>
<td>.ununload(fn)</td>
<td>.unbind(&#8221;unload&#8221;,fn)</td>
</tr>
<tr>
<td>.unclick(fn)</td>
<td>.unbind(&#8221;click&#8221;,fn)</td>
</tr>
<tr>
<td>.undblclick(fn)</td>
<td>.unbind(&#8221;dblclick&#8221;,fn)</td>
</tr>
<tr>
<td>.unmousedown(fn)</td>
<td>.unbind(&#8221;mousedown&#8221;,fn)</td>
</tr>
<tr>
<td>.unmouseup(fn)</td>
<td>.unbind(&#8221;mouseup&#8221;,fn)</td>
</tr>
<tr>
<td>.unmousemove(fn)</td>
<td>.unbind(&#8221;mousemove&#8221;,fn)</td>
</tr>
<tr>
<td>.unmouseover(fn)</td>
<td>.unbind(&#8221;mouseover&#8221;,fn)</td>
</tr>
<tr>
<td>.unmouseout(fn)</td>
<td>.unbind(&#8221;mouseout&#8221;,fn)</td>
</tr>
<tr>
<td>.unchange(fn)</td>
<td>.unbind(&#8221;change&#8221;,fn)</td>
</tr>
<tr>
<td>.unreset(fn)</td>
<td>.unbind(&#8221;reset&#8221;,fn)</td>
</tr>
<tr>
<td>.unselect(fn)</td>
<td>.unbind(&#8221;select&#8221;,fn)</td>
</tr>
<tr>
<td>.unsubmit(fn)</td>
<td>.unbind(&#8221;submit&#8221;,fn)</td>
</tr>
<tr>
<td>.unkeydown(fn)</td>
<td>.unbind(&#8221;keydown&#8221;,fn)</td>
</tr>
<tr>
<td>.unkeypress(fn)</td>
<td>.unbind(&#8221;keypress&#8221;,fn)</td>
</tr>
<tr>
<td>.unkeyup(fn)</td>
<td>.unbind(&#8221;keyup&#8221;,fn)</td>
</tr>
<tr>
<td>.unerror(fn)</td>
<td>.unbind(&#8221;error&#8221;,fn)</td>
</tr>
</table>
<h3>Download</h3>
<p>It&#8217;s in alpha, so this is for testing only, but here&#8217;s the link.</p>
<p><a href="http://jquery.com/src/jquery-1.1a.js">jQuery version 1.1a</a></p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/big-speed-increases-with-jquery-11a/34/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery Online Movie Tutorial by John Resig</title>
		<link>http://15daysofjquery.com/jquery-online-movie-tutorial-by-john-resig/29/</link>
		<comments>http://15daysofjquery.com/jquery-online-movie-tutorial-by-john-resig/29/#comments</comments>
		<pubDate>Wed, 03 Jan 2007 15:10:36 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/jquery-online-movie-tutorial-by-john-resig/29/</guid>
		<description><![CDATA[John Resig, creator of jQuery javascript library, has posted an online video about how to make an accordion style menu using jQuery.

Pretty basic stuff&#8230; but a good intro to jQuery if you&#8217;re new to this.
]]></description>
			<content:encoded><![CDATA[<p>John Resig, creator of jQuery javascript library, has posted an online video about how to make an accordion style menu using jQuery.</p>
<p><embed src="http://www.vimeo.com/moogaloop.swf?clip_id=116991" quality="best" scale="exactfit" width="400" height="300" type="application/x-shockwave-flash"></embed></p>
<p>Pretty basic stuff&#8230; but a good intro to jQuery if you&#8217;re new to this.</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/jquery-online-movie-tutorial-by-john-resig/29/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery Tutorial Ideas Wanted</title>
		<link>http://15daysofjquery.com/jquery-tutorial-ideas-wanted/28/</link>
		<comments>http://15daysofjquery.com/jquery-tutorial-ideas-wanted/28/#comments</comments>
		<pubDate>Thu, 14 Dec 2006 15:23:21 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/jquery-tutorial-ideas-wanted/28/</guid>
		<description><![CDATA[Over on John Resig&#8217;s blog he&#8217;s asking people to submit ideas about different types of tutorials they want to see for jQuery. I have a two part tutorial about to be released that is going to knock your socks off, but I&#8217;d love to know what sort of tutorials you&#8217;d like to see at 15 [...]]]></description>
			<content:encoded><![CDATA[<p>Over on John Resig&#8217;s blog he&#8217;s asking people to submit ideas about different types of <a href="http://jquery.com/blog/2006/12/13/helping-you-understand-jquery/">tutorials they want to see for jQuery</a>. I have a two part tutorial about to be released that is going to knock your socks off, but I&#8217;d love to know what sort of tutorials you&#8217;d like to see at <a href="http://15daysofjquery.com">15 days of jQuery</a>.</p>
<p>With the <a href="http://jquery.com/blog/2006/12/12/jquery-104/">recent release of version 1.0.4 of jQuery</a> I have gotten some great ideas for some upcoming tutorials that you&#8217;ll be seeing in the next few days and weeks. And if you haven&#8217;t signed up for my RSS feed, now&#8217;s a great time, since these tutorials are just over the horizon. At the bottom of this post you&#8217;ll see a link for subscribing to the RSS feed, or RSS-to-email.</p>
<p>Some of what I have on the way includes:</p>
<ul>
<li>Why select boxes in your form need to die - Part 1</li>
<li>Why select boxes in your form need to die - Part 2</li>
<li>AJAX with jQuery revisited - Parts 1 and 2</li>
<li>Marketing lessons learned from John Resig</li>
</ul>
<p>I&#8217;m also going to be fishing back through my notes and finding a handful of excellent interviewees for podcasts.</p>
<p>So, if you haven&#8217;t added 15 days of jQuery to your RSS reader, or if you want to receive updates by email, now&#8217;s the time to <a href="/subscribe/">subscribe</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/jquery-tutorial-ideas-wanted/28/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Version of jQuery Released</title>
		<link>http://15daysofjquery.com/new-version-of-jquery-released/26/</link>
		<comments>http://15daysofjquery.com/new-version-of-jquery-released/26/#comments</comments>
		<pubDate>Wed, 13 Dec 2006 20:24:07 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/new-version-of-jquery-released/26/</guid>
		<description><![CDATA[Just announced today, version 1.0.4 of jQuery was released. I&#8217;ll be updating my installation of jQuery on the 15 Days of jQuery blog and also releasing new tutorials in the coming days and weeks.
John Resig and company squashed a whole bunch of bugs.
They also added some innovative features I&#8217;ll have to investigate further, and then [...]]]></description>
			<content:encoded><![CDATA[<p>Just announced today, version <a href="http://jquery.com/blog/2006/12/12/jquery-104/">1.0.4 of jQuery</a> was released. I&#8217;ll be updating my installation of jQuery on the 15 Days of jQuery blog and also releasing new tutorials in the coming days and weeks.</p>
<p>John Resig and company squashed a whole bunch of <a href="http://jquery.com/dev/bugs/10/?sort=ticket&#038;asc=0">bugs</a>.</p>
<p>They also added some innovative features I&#8217;ll have to investigate further, and then I&#8217;ll whip up some new tutorials.  (Yes, it&#8217;s been a while since I posted.  I do these in spurts, and I feel one comin&#8217; on.)</p>
<p>As far as specifics on features, some of the cooler ones look like extensions to the $.ajax() </p>
<p>A few examples straight off of <a href="http://ejohn.org/blog/">John Resig</a>&#8217;s blog:</p>
<p><b>Example: Add extra headers to an Ajax request using beforeSend</b></p>
<pre>$.ajax({
  type: "POST",
  url: "/files/add/",
  beforeSend: function(xhr) {
    xhr.setRequestHeader( "Content-type", "text/plain" );
  },
  data: "This is the contents of my text file."
});</pre>
<p><b>Example: Perform a synchronous Ajax request.</b></p>
<pre>// Get the HTML of a web page and save it
// to a variable (the browser will freeze until the
// entire request is completed).
var html = $.ajax({
  type: "GET",
  url: "test.html",
  async: false
}).responseText;

// Add the HTML into the page
$("#list").html( html );</pre>
<p><b>Example: Sending a JavaScript object using processData.</b></p>
<pre>// The data to send to the server
var params = {
  name: "John",
  city: "Boston"
};

$.ajax({
  type: "POST",
  url: "/user/add/",
  processData: params
});</pre>
<p><b>Example: Aborting an Ajax request after a specific delay in time.</b></p>
<pre>// Perform a simple Ajax request
var req = $.ajax({
  type: "GET",
  url: "/user/list/",
  success: function(data) {
    // Do something with the data...
    // Then remove the request.
    req = null;
  }
});

// Wait for 5 seconds
setTimeout(function(){
  // If the request is still running, abort it.
  if ( req ) req.abort();
}, 5000);</pre>
<p>Another nice addition is a way to make pageX and pageY variables available in all browsers.</p>
<p><b>Example: Have a tooltip follow a user&#8217;s mouse around the page.</b></p>
<pre>$(document).mousemove(function(e){
  $("#mousetip").css({
    top: e.pageY + "px",
    left: e.pageX + "px"
  });
});</pre>
<p>I&#8217;ll have to take a closer look at these new features, play around a bit, and post my findings in some new tutorials. I got a comment today about the old AJAX tutorial I did a while back being a bit outdated with the video cast I did, and some of the new $.ajax() calls in jQuery, so I think it&#8217;s time to revisit jQuery&#8217;s implementation of AJAX and crank out a few new tutorials.</p>
<p>Stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/new-version-of-jquery-released/26/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery Just Keeps Getting Better and Better!</title>
		<link>http://15daysofjquery.com/jquery-just-keeps-getting-better-and-better/23/</link>
		<comments>http://15daysofjquery.com/jquery-just-keeps-getting-better-and-better/23/#comments</comments>
		<pubDate>Thu, 03 Aug 2006 17:41:36 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/jquery-just-keeps-getting-better-and-better/23/</guid>
		<description><![CDATA[Through my subscription to John Resig&#8217;s RSS feed (he created jQuery) I have noticed a flurry of activity over the past several weeks.
I&#8217;ve been burdened with a ton of projects I&#8217;ve been putting finishing touches on and so I haven&#8217;t had time until now to post about all the new plugins and great contributions to [...]]]></description>
			<content:encoded><![CDATA[<p>Through my subscription to John Resig&#8217;s RSS feed (he created jQuery) I have noticed a flurry of activity over the past several weeks.</p>
<p>I&#8217;ve been burdened with a ton of projects I&#8217;ve been putting finishing touches on and so I haven&#8217;t had time until now to post about all the new plugins and great contributions to jQuery.</p>
<p>First, you shoud make yourself familiar with jQuery&#8217;s development page.  This is where John is linking to the Best of the Best jQuery plugins.</p>
<p><a href="http://proj.jquery.com/plugins/">http://proj.jquery.com/plugins/</a></p>
<h3>Some of My Favorites</h3>
<p><a href="http://www.acko.net/dev/farbtastic">Farbtastic color picker</a> - awesome. It&#8217;s tough to choose between this one and one I&#8217;ve seen on Yahoo&#8217;s site for use with their YUI.</p>
<p><a href="http://motherrussia.polyester.se/jquery-plugins/tablesorter/">Table sorting plugin</a></p>
<p><a href="http://kelvinluck.com/assets/jquery/datePicker/">Date picker</a> - another addition by Kelvin Luck.  Great job.</p>
<p><a href="http://be.twixt.us/jquery/">Suckerfish Menus</a> - and also a very slick &#8220;tree&#8221; that can be collapsed and expanded</p>
<h3>And Great News for jQuery Fans</h3>
<p>John Resig has kept us up to date on some great hat tips from third party sites and software developers.</p>
<p>Technorati&#8217;s new design uses jQuery&#8230;</p>
<p>Soon to be released versions of Drupal will include jQuery in the code&#8230;</p>
<p>jQuery&#8217;s starting to get popular, it seems.</p>
<h3>Amazing Demos</h3>
<p>Dustin Diaz did a great Tetris rendition using YUI library. Recently someone came out with one for jQuery.</p>
<p><a href="http://fmarcia.info/jquery/tetris/tetris.html">jQuery Tetris</a></p>
<p>And how about a 3D universe&#8230; prepare to be amazed.</p>
<p><a href="http://www.willjessup.com/sandbox/jquery/solar_system/rotator.html">Spinning 3D Universe with jQuery</a></p>
<p>Okay&#8230; back to work for me. <img src='http://15daysofjquery.com/wpblog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/jquery-just-keeps-getting-better-and-better/23/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Draggable Droppables And Selectables&#8230; Oh My</title>
		<link>http://15daysofjquery.com/draggable-droppables-and-selectables-oh-my/22/</link>
		<comments>http://15daysofjquery.com/draggable-droppables-and-selectables-oh-my/22/#comments</comments>
		<pubDate>Mon, 10 Jul 2006 13:45:06 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/draggable-droppables-and-selectables-oh-my/22/</guid>
		<description><![CDATA[When I first started 15DaysOfjQuery.com I made this comment on one of the &#8216;About&#8216; pages:
If you need super fancy effects for animation, drag and drop, and super smooth animation then youâ€™ll probably want to use Prototype and one of the many great library created to enhance the effects.
I left my erroneous remark up to show [...]]]></description>
			<content:encoded><![CDATA[<p>When I first started <a href="http://15daysofjquery.com">15DaysOfjQuery.com</a> I made this comment on one of the &#8216;<a href="http://15daysofjquery.com/about-jquery-library/">About</a>&#8216; pages:</p>
<blockquote><p>If you need super fancy effects for animation, drag and drop, and super smooth animation then youâ€™ll probably want to use Prototype and one of the many great library created to enhance the effects.</p></blockquote>
<p>I left my erroneous remark up to show you how quickly jQuery has been adopted by talented javascript coders willing and able to cook up plugins that give the &#8220;older&#8221; AJAX libraries a run for their money.</p>
<p>You see, a few days after posting the &#8220;limitations&#8221; of jQuery it came to my attention that a very talented coder was busy publishing some <a href="http://interface.eyecon.ro/">exciting animation plugins for jQuery</a> that could be very useful for web apps.</p>
<p>For example, I had been toying with a sortable list for the admin control panel in my new content management system. I was getting very frustrated with a <a href="http://www.gregphoto.net/sortable/advanced/">PHP coded version</a> of <a href="http://wiki.script.aculo.us/scriptaculous/show/SortableListsDemo">&#8220;sortable lists&#8221;</a> found at <a href="http://script.aculo.us/">Scriptaculous</a>. The code wasn&#8217;t able to handle the latest version of Prototype&#8230; but looked so promising.</p>
<p><em>Note: the PHP version on gregphoto.net now appears to be updated - but I haven&#8217;t tested it myself. So if you like Prototype better than jQuery, I&#8217;d check out his code. Also, I find it interesting that the sortable list demo on Scriptaculous doesn&#8217;t work at all in FireFox - and hasn&#8217;t for some time now. I don&#8217;t know if that&#8217;s a coding error on their site, or a bug in the code itself.</em></p>
<p>When I found the <a href="http://interface.eyecon.ro/demos/sort.html">jQuery plugin for sortable lists</a> I couldn&#8217;t believe how damn easy the code was to make it easy to sort several lists, mix and match the lists, and send the information to a database.</p>
<p>I was in hog heaven!</p>
<p>Since then, the <a href="http://interface.eyecon.ro/">number of interface plugins has grown steadily</a>. I think you&#8217;d have to really try hard to come up with an interface effect that can&#8217;t be accomplished with jQuery and these wonderful plugins.</p>
<h3>&#8220;XYZ Ajax Library Is Better&#8221;</h3>
<p>If you have an AJAX library you like better, then please continue using it. Not that I don&#8217;t want to hear a well thought out comment about the differences between various libraries - their strengths and weaknesses - but the point of this post is to show that jQuery is more than just a lightweight javascript library for DOM manipulation with a little AJAX thrown in&#8230; </p>
<p>On the contrary&#8230; you can use <a href="http://interface.eyecon.ro/demos/sort.html">jQuery to accomplish some very sophisticated effects</a>.</p>
<p>I know there are some very smart coders that prefer YUI, or Prototype, Dojo, or fill-in-the-blank. I also know that some very <a href="http://simon.incutio.com/archive/2006/06/26/libraries">influential and smart coders are giving jQuery a second look</a>.</p>
<p>jQuery is maturing rapidly. Talented coders are contributing to the library and there&#8217;s an active community discussing ways to make the library even better.</p>
<p>[tags]jQuery, animation, javascript, AJAX, Prototype, Scriptaculous, Dojo, web app, jQuery effects, sortable lists[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/draggable-droppables-and-selectables-oh-my/22/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Javascript Tooltips on Steroids</title>
		<link>http://15daysofjquery.com/javascript-tooltips-on-steroids/21/</link>
		<comments>http://15daysofjquery.com/javascript-tooltips-on-steroids/21/#comments</comments>
		<pubDate>Thu, 06 Jul 2006 14:17:44 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/javascript-tooltips-on-steroids/21/</guid>
		<description><![CDATA[Note: This is an update to my original post, which can be seen here: jQuery Tooltips
Cody Lindley, author of Thickbox, recently released jTip - The jQuery Tooltip.
I really like some of the extra bells and whistles that these tooltips provide. I&#8217;m sure that there are those among you that think there&#8217;s no need for yet [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Note: This is an update to my original post, which can be seen here: <a href="http://15daysofjquery.com/jquery-tooltips/20/">jQuery Tooltips</a></strong></p>
<p>Cody Lindley, author of Thickbox, recently released <a href="http://codylindley.com/Javascript/264/jtip-a-jquery-tool-tip">jTip - The jQuery Tooltip</a>.</p>
<p>I really like some of the <a href="http://www.codylindley.com/blogstuff/js/jtip/">extra bells and whistles that these tooltips provide</a>. I&#8217;m sure that there are those among you that think there&#8217;s no need for yet another tooltip - but I can see some exciting applications for Cody&#8217;s idea in my own work.</p>
<p>The one big issue I had when I looked at the html source has to do with accessibility - links not working if javascript is turned off. I&#8217;m not inclined to look at all javascript through the accessibility prism, but it just seemed to me that there could be another way to create the same effect in a slightly better way.</p>
<p>Specifically, I didn&#8217;t like the idea of sacrificing the usability of a true link to another page for the benefit of the tooltip on hover. I love the tooltip - and no disrespect to Cody - but for the application I&#8217;m considering I <strong>need </strong>that link to work no matter what.</p>
<p>So what I&#8217;ve got for you today is a minor modification of Cody&#8217;s script. If you&#8217;re not a fan of his tooltips, then my rendition probably won&#8217;t wow you either. But if you like what he&#8217;s done and want links that will still work with javascript turned off, well this might just be right up your alley.</p>
<h3>My Changes</h3>
<p>The link that really got me thinking about tinkering with his code a bit was the one for yahoo. It leads to an external site (Yahoo), has a great little tooltip on mouseover, but I just didn&#8217;t like this code he used to create it:</p>
<pre>
&lt;a href=&quot;yahoo.htm?width=175&amp;amp;link=http://www.yahoo.com&quot; 

name=&quot;Before You Click...&quot;
id=&quot;yahooCopy&quot;
class=&quot;jTip&quot;&gt;
Go To Yahoo&lt;/a&gt;
</pre>
<p>So I rewired some of his script and now the same effect can be achieved like so:</p>
<pre>
&lt;a href=&quot;http://www.yahoo.com&quot;
rel=&quot;yahoo.htm?width=175&amp;link=yahoo&amp;name=Before%20
%20You%20Click...&quot;
id=&quot;yahooCopy&quot;
class=&quot;jTip&quot;&gt;
Go To Yahoo&lt;/a&gt;
</pre>
<p><a href="http://15daysofjquery.com/examples/jqueryTooltips/demo2.php">Demonstration of my code</a></p>
<p><strong>Improvement: HTML Validates</strong></p>
<p>My new code validates, according to w3.org</p>
<p><strong>Improvement: Naming</strong></p>
<p>As I was going through the code, making some small changes, I noticed that Cody used a variable called &#8216;title&#8217; that was assigned the value found in the name of the link. This could be a bit confusing.</p>
<p>I addressed the naming issue, even though I think it&#8217;s of little importance. </p>
<p><strong>Improvement: Usability</strong></p>
<p>With my code, you can choose to have each tooltip a genuine link to another document, internal or external. Or, if you just want the tooltip and don&#8217;t care about usability, you can choose to leave the link out of the equation.</p>
<p>The choice is yours.</p>
<h3>Hat Tip</h3>
<p>Cody came up with a great concept and saved me tons of time by doing the heavy lifting. My modification is in no way a criticism - just a slight &#8220;tweak&#8221; that I thought my readers might appreciate.</p>
<p>Enjoy.</p>
<p>[tags]javascript, tooltip, Cody Lindley, jQuery, accesibility[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/javascript-tooltips-on-steroids/21/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery Tooltips</title>
		<link>http://15daysofjquery.com/jquery-tooltips/20/</link>
		<comments>http://15daysofjquery.com/jquery-tooltips/20/#comments</comments>
		<pubDate>Thu, 06 Jul 2006 13:46:34 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/jquery-tooltips/20/</guid>
		<description><![CDATA[Cody Lindley, author of Thickbox, recently released jTip - The jQuery Tooltip.
I really like some of the extra bells and whistles that these tooltips provide. I&#8217;m sure that there are those among you that think there&#8217;s no need for yet another tooltip - but I can see some exciting applications for Cody&#8217;s idea in my [...]]]></description>
			<content:encoded><![CDATA[<p>Cody Lindley, author of Thickbox, recently released <a href="http://codylindley.com/Javascript/264/jtip-a-jquery-tool-tip">jTip - The jQuery Tooltip</a>.</p>
<p>I really like some of the <a href="http://www.codylindley.com/blogstuff/js/jtip/">extra bells and whistles that these tooltips provide</a>. I&#8217;m sure that there are those among you that think there&#8217;s no need for yet another tooltip - but I can see some exciting applications for Cody&#8217;s idea in my own work.</p>
<p>The one big issue I had when I looked at the html source has to do with accessibility - links not working if javascript is turned off. I&#8217;m not inclined to look at all javascript through the accessibility prism, but it just seemed to me that there could be another way to create the same effect in a slightly better way.</p>
<p>Specifically, I didn&#8217;t like the idea of sacrificing the usability of a true link to another page for the benefit of the tooltip on hover. I love the tooltip - and no disrespect to Cody - but for the application I&#8217;m considering I <strong>need </strong>that link to work no matter what.</p>
<p>So what I&#8217;ve got for you today is a minor modification of Cody&#8217;s script. If you&#8217;re not a fan of his tooltips, then my rendition probably won&#8217;t wow you either. But if you like what he&#8217;s done and want links that will still work with javascript turned off, well this might just be right up your alley.</p>
<h3>My Changes</h3>
<p><strong>*** Update: Within 15 minutes of posting, <a href="http://15daysofjquery.com/javascript-tooltips-on-steroids/21/">I came up with a way to make the code accessible and have the html validate</a>. I will leave this post here so that you can see the evolution of my changes (and thinking).</strong></p>
<p><strong><br />
Both of the objections below should be resolved with the <a href="http://15daysofjquery.com/examples/jqueryTooltips/demo2.php">new code.</a></strong></p>
<p>The link that really got me thinking about tinkering with his code a bit was the one for yahoo. It leads to an external site (Yahoo), has a great little tooltip on mouseover, but I just didn&#8217;t like this code he used to create it:</p>
<pre>
&lt;a href=&quot;yahoo.htm?width=175&amp;amp;link=http://www.yahoo.com&quot; 

name=&quot;Before You Click...&quot;
id=&quot;yahooCopy&quot;
class=&quot;jTip&quot;&gt;
Go To Yahoo&lt;/a&gt;
</pre>
<p>So I rewired some of his script and now the same effect can be achieved like so:</p>
<pre>
&lt;a href=&quot;http://www.yahoo.com&quot;
name=&quot;yahoo.htm?width=175&amp;link=yahoo&amp;name=Before
You Click...&quot;
id=&quot;yahooCopy&quot;
class=&quot;jTip&quot;&gt;
Go To Yahoo&lt;/a&gt;
</pre>
<p><a href="http://15daysofjquery.com/examples/jqueryTooltips/demo.php">Demonstration of my code</a></p>
<p><strong>Objection: Doesn&#8217;t validate</strong></p>
<p>I&#8217;ll bring this up so someone else doesn&#8217;t need to. Checking validator.w3.org indicates that even my newer version of the code doesn&#8217;t validate.</p>
<p>Some of you will choose the benefits of this tooltip over strict validation. Other of you won&#8217;t. Your choice is your choice and I&#8217;m not one to tell you you&#8217;re wrong or right.</p>
<p><strong>Objection: Strange naming</strong></p>
<p>As I was going through the code, making some small changes, I noticed that Cody used a variable called &#8216;title&#8217; that was assigned the value found in the name of the link. This could be a bit confusing.</p>
<p>I compounded the issue by adding a variable called <em>name </em>to the information found in the name of the link. </p>
<p>Lame excuse: I chose speed over perfection. I wanted to get this tutorial wrapped up because it was way over due (in my mind) and with <a href="http://cmslaunch.com/">other things on my plate</a>, I decided not to aim for supreme perfection.</p>
<p>Perhaps I&#8217;ll rewrite the code in the coming days.</p>
<h3>Hat Tip</h3>
<p>Cody came up with a great concept and saved me tons of time by doing the heavy lifting. My modification is in no way a criticism - just a slight &#8220;tweak&#8221; that I thought my readers might appreciate.</p>
<p>Enjoy.</p>
<p>[tags]javascript, tooltip, Cody Lindley, jQuery, accesibility[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/jquery-tooltips/20/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery Tabs</title>
		<link>http://15daysofjquery.com/jquery-tabs/18/</link>
		<comments>http://15daysofjquery.com/jquery-tabs/18/#comments</comments>
		<pubDate>Tue, 27 Jun 2006 14:52:24 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/jquery-tabs/18/</guid>
		<description><![CDATA[A fellow named Klaus has created a nifty little plugin that creates accessible unobtrusive javascript tabs using jQuery.
With the correct (x)HTML and CSS you can create tabs as easily as 

$.tabs("container"); // first tab on by default

If you want to have the second tab &#8220;on&#8221; by default:

$.tabs("container", 2); // second tab on

Klaus has an example [...]]]></description>
			<content:encoded><![CDATA[<p>A fellow named Klaus has created a nifty little plugin that creates <a href="http://stilbuero.de/2006/05/13/accessible-unobtrusive-javascript-tabs-with-jquery/">accessible unobtrusive javascript tabs</a> using jQuery.</p>
<p>With the correct (x)HTML and CSS you can create tabs as easily as </p>
<pre>
$.tabs("container"); // first tab on by default
</pre>
<p>If you want to have the second tab &#8220;on&#8221; by default:</p>
<pre>
$.tabs("container", 2); // second tab on
</pre>
<p>Klaus has an <a href="http://stilbuero.de/demo/jquery/tabs.html">example</a> that you can view to see the end result.</p>
<h3>My Contribution</h3>
<p>I had to do <strong>something </strong>to add to Klaus&#8217; contribution so I came up with a <a href="http://15daysofjquery.com/examples/jqueryTabs/">simple form that you can use to generate the markup for the tabs</a>.</p>
<p><strong>Instructions:</strong></p>
<p>It&#8217;s very simple.  Just type a name for each tab (up to 5) and click the button at the bottom of the form. The next page will generate the html you can copy and paste into your file.</p>
<p>You will also need to <a href="http://stilbuero.de/2006/05/13/accessible-unobtrusive-javascript-tabs-with-jquery/">download the CSS from Klaus&#8217; site</a>, modify it as you see fit, and of course upload the <a href="http://jquery.com">jQuery</a> javascript library to your server.</p>
<p>Here is the link for the <a href="http://15daysofjquery.com/examples/jqueryTabs/">tab markup generator</a>.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/jquery-tabs/18/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery Lightbox</title>
		<link>http://15daysofjquery.com/jquery-lightbox/19/</link>
		<comments>http://15daysofjquery.com/jquery-lightbox/19/#comments</comments>
		<pubDate>Thu, 22 Jun 2006 13:29:22 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/jquery-lightbox/19/</guid>
		<description><![CDATA[Cody Lindley&#8217;s first rendition of &#8220;Thickbox&#8221; was what got me interested in jQuery. He&#8217;s since done an update on Thickbox to fix some cross browser compatibility issues.
A few things to notice
$(document).ready kicks off the TB_init() function, which in turn attaches an onClick event to all links with the class name of &#8220;thickbox&#8221;.

function TB_init(){

	$("a.thickbox").click(function(){

	var t = [...]]]></description>
			<content:encoded><![CDATA[<p>Cody Lindley&#8217;s first rendition of &#8220;<a href="http://codylindley.com/Javascript/257/thickbox-one-box-to-rule-them-all">Thickbox</a>&#8221; was what got me interested in jQuery. He&#8217;s since done an <a href="http://codylindley.com/Javascript/257/thickbox-one-box-to-rule-them-all">update on Thickbox</a> to fix some cross browser compatibility issues.</p>
<h3>A few things to notice</h3>
<p>$(document).ready kicks off the TB_init() function, which in turn attaches an onClick event to all links with the class name of &#8220;thickbox&#8221;.</p>
<pre>
function TB_init(){

	$("a.thickbox").click(function(){

	var t = this.title || this.innerHTML || this.href;

	TB_show(t,this.href);

	this.blur();

	return false;

	});
</pre>
<p>When a &#8220;thickbox&#8221; link is clicked, the TB_show() function fires.</p>
<pre>
$(&quot;body&quot;)
 .append(&quot;&lt;div id='TB_overlay'&gt;&lt;/div&gt;&lt;div id='TB_window'&gt;&lt;/div&gt;&quot;);
 $(&quot;#TB_overlay&quot;).click(TB_remove);
 $(window).resize(TB_position);
 $(window).scroll(TB_position);

 $(&quot;#TB_overlay&quot;).show();
 $(&quot;body&quot;).append(&quot;&lt;div id='TB_load'&gt;&lt;div id='TB_loadContent'&gt;&lt;img
  src='images/circle_animation.gif' /&gt;&lt;/div&gt;&lt;/div&gt;&quot;);
</pre>
<p>As you can see above, there are two divs that are appended to the document body. In other words, the two divs are added to the end of the html just before the closing body tag.</p>
<p>The overlay div is styled by css to have an opaque appearance. The TB_window is where the script will place an image or pull in another web page using AHAH.</p>
<p>$(window).resize and $(window).scroll tell jQuery to fire off the TB_position function if the window is resized by the visitor or if the visitor scrolls down the page. This is how Thickbox is able to stay in the middle of the page when you scroll or resize the window.</p>
<p>Next, Cody searches the url passed to the Thickbox code to find the suffix. </p>
<pre>
var urlString = /\.jpg|\.jpeg|\.png|\.gif|\.html|\.htm|\.php|\.cfm|\.asp|\.aspx|\.jsp|\.jst|\.rb|\.txt/g;

		var urlType = url.match(urlString);

		if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif'){//code to show images
</pre>
<p>If it&#8217;s an image, then the jQuery append function is used to add the html to the appropriate spot.</p>
<pre>
$(&quot;#TB_window&quot;).append(&quot;&lt;a href='' id='TB_ImageOff' title='Close'&gt;&lt;img
id='TB_Image' src='&quot;+url+&quot;' width='&quot;+imageWidth+&quot;' height='&quot;+imageHeight+&quot;'
alt='&quot;+caption+&quot;'/&gt;&lt;/a&gt;&quot;
 + &quot;&lt;div id='TB_caption'&gt;&quot;+caption+&quot;&lt;/div&gt;&lt;div
  id='TB_closeWindow'&gt;&lt;a href='#' id='TB_closeWindowButton'&gt;close&lt;/a&gt;&lt;/div&gt;&quot;); 

 $(&quot;#TB_closeWindowButton&quot;).click(TB_remove);
</pre>
<p>Otherwise, the remote file is pulled in using the jQuery load() function.</p>
<pre>
$("#TB_ajaxContent").load(url, function(){
</pre>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/jquery-lightbox/19/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Multiple File Upload Magic With Unobtrusive Javascript</title>
		<link>http://15daysofjquery.com/multiple-file-upload-magic-with-unobtrusive-javascript/17/</link>
		<comments>http://15daysofjquery.com/multiple-file-upload-magic-with-unobtrusive-javascript/17/#comments</comments>
		<pubDate>Mon, 19 Jun 2006 15:21:08 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/multiple-file-upload-magic-with-unobtrusive-javascript/17/</guid>
		<description><![CDATA[Warning - the demos are for this tutorial went a little crazy when I recently made a change to the jquery file.  I will be working to bring the demos for this tutorial back online.  Until then, don&#8217;t view the tutorials if you are using IE.

Many months ago, when trying to catch up [...]]]></description>
			<content:encoded><![CDATA[<p>Warning - the demos are for this tutorial went a little crazy when I recently made a change to the jquery file.  I will be working to bring the demos for this tutorial back online.  Until then, don&#8217;t view the tutorials if you are using IE.</p>
<hr />
<p>Many months ago, when trying to catch up to all the AJAX hype, I was surfing the <a href="http://www.fiftyfoureleven.com/resources/programming/javascript">FiftyFourEleven</a> site looking at wonderful examples of innovative javascript code when I stumbled up some code for &#8220;<a href="http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/">Upload Multiple Files With A Single File Element</a>&#8220;.</p>
<p>So when I decided to launch 15 Days of jQuery, this was one of the very first scripts that I wanted to give a jQuery makeover.</p>
<h3>Enter the Accessibility Zealots</h3>
<p>Looking through my server logs a few days ago I see that I&#8217;ve got a trackback from a site I don&#8217;t recognize. I check it out only to discover that two of my jQuery tutorials are being listed as an example of what the author hates about javascript.</p>
<p>According to this twerp, any tool or technique that doesn&#8217;t put accessibility as the numero uno priority is <strong>bad</strong>.</p>
<p>Although I strongly disagree with this widely held belief, it got me thinking about this particular tutorial. I went back to the drawing board and created a way to create a similar effect unobtrusively&#8230; so that if my critic decides to visit with javascript turned off, he&#8217;ll be able to use the form too.</p>
<h3>Two Tutorials for The Price of One</h3>
<p><strong>Goal #1: </strong>To permit multiple file uploads using one file input element&#8230; and to make the whole interaction sexy.</p>
<p><strong>Goal #2:</strong> To make multiple file uploads sexy&#8230; without sacrificing usability. The focus here is unobtrusive javascript to shape a form with multiple file input fields.</p>
<h3>The Examples</h3>
<p>Demonstration one - only one file input element, but with the addition of jQuery and some custom code that you&#8217;re about to see it becomes a user-friendly multiple file upload script.</p>
<p><a href="http://15daysofjquery.com/examples/multiFile/demo1.php">Multiple file upload with one file input</a></p>
<p>Demonstration two - multiple file input elements in the (x)html source of the form but jQuery modifies what the visitor sees and gives a similar feel to the first demonstration. The advantage to this method is that it is unobtrusive&#8230; with javascript turned off the visitor can still upload multiple files.</p>
<p><a href="http://15daysofjquery.com/examples/multiFile/demo2.php">Multiple file upload with several file inputs</a></p>
<h3>Explanation</h3>
<p><strong>Single file input - </strong></p>
<p>The jQuery $(document).ready() function does two things:</p>
<p>Creates a div where the maximum files allowed is shown to the visitor.<br />
Finds the file upload field (assuming there is only one) and attaches an onChange event to it.</p>
<pre>
$("input[@type=file]&#8220;).change(function(){
doIt(this, fileMax);
});
</pre>
<p>The doIt() function (nice name, huh?) checks to see if the maximum file limit has been reached, and if not, it hides the file input field, adds a new one inside the containing div, puts the name of the file chosen inside the div with id &#8220;files_list&#8221;, and adds a Delete button on the end.</p>
<p>To navigate the DOM tree I use jQuery&#8217;s parent() function and then remove elements using the remove() function. I also make use of append() and prepend() to add in the file names and new input fields respectively.</p>
<p>Two key points:</p>
<p>1- You determine the maximum number of files allowed with this line</p>
<pre>
var fileMax = 3;
</pre>
<p>2- The file input fields must be named appropriately</p>
<pre>
&lt;input type=&quot;file&quot; class=&quot;upload&quot; name=&quot;fileX[]&quot;
  /&gt;
</pre>
<p>I do this so that the fields can be added and removed by the visitor without any concern for keeping track of id&#8217;s or names. When the form is submitted to a server side script, the information is sent in an array that can be easily traversed.</p>
<p><strong>Multiple file input - </strong></p>
<p>This was was trickier to pull off.</p>
<p>First, the number of files allowed is determined by the number of file input fields in your (x)html. Second, you should still name them in a way that stacks the field information into an array.</p>
<pre>
&lt;input type=&quot;file&quot; class=&quot;upload&quot; name=&quot;fileX[]&quot;
  /&gt;
</pre>
<p>The big difference in this second version is that I loop through each file input field and apply the doIt() function when the field value changes. By looping through each one, I can send an additional piece of information that&#8217;s critical to my code: the order of the field in the &#8220;stack&#8221;.</p>
<p>In other words, as the code executes, it&#8217;s specifically targeting the first input field, or the second, or the third.</p>
<p>The code for this is found here:</p>
<pre>
$(&quot;input[@type=file]:nth-of-type(&quot;+n+&quot;)&quot;)
</pre>
<p>jQuery&#8217;s flexibility allows me to use CSS and XPath descriptions to target specific elements.</p>
<p>You&#8217;ll notice that as each file is chosen, the file input field is replaced by the name of the file. Clicking on the name of the file allows you to choose a different file.</p>
<p>[tags]multiple file upload, javascript, DOM, unobtrusive, jQuery[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/multiple-file-upload-magic-with-unobtrusive-javascript/17/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Edit In Place with AJAX Using jQuery Javascript Library</title>
		<link>http://15daysofjquery.com/edit-in-place-with-ajax-using-jquery-javascript-library/15/</link>
		<comments>http://15daysofjquery.com/edit-in-place-with-ajax-using-jquery-javascript-library/15/#comments</comments>
		<pubDate>Wed, 14 Jun 2006 19:28:17 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/edit-in-place-with-ajax-using-jquery-javascript-library/15/</guid>
		<description><![CDATA[I originally saw a version of this concept on Quirksmode and then a more Web 2.0-ish version on the 24 Ways site.
I&#8217;m going to show you two ways that you could use jQuery to accomplish the same effect, or better.
The Goal
An AJAX (or AHAH) proof-of-concept page that allows the visitor to edit the very (x)HTML [...]]]></description>
			<content:encoded><![CDATA[<p>I originally saw a version of this concept on <a href="http://www.quirksmode.org/index.html?/dom/cms.html">Quirksmode </a>and then a more Web 2.0-ish version on the <a href="http://24ways.org/advent/edit-in-place-with-ajax">24 Ways</a> site.</p>
<p>I&#8217;m going to show you <em><strong>two </strong></em>ways that you could use jQuery to accomplish the same effect, or better.</p>
<h3>The Goal</h3>
<p>An AJAX (or AHAH) proof-of-concept page that allows the visitor to edit the very (x)HTML page they are viewing, without leaving the page.</p>
<h3>The Concept</h3>
<p>Click the text to be edited and magically a textarea appears with buttons beneath to save or cancel the changes. Changes are sent via AHAH to a PHP script which normally would be used to update a database (MYSQL or flatfile).</p>
<h3>The Demonstration</h3>
<p><a href="http://15daysofjquery.com/examples/jqueryEditInPlace/divEdit.php" target="_blank">Edit In Place Using Ajax 1</a></p>
<p>In this first demonstration, I&#8217;m using a div with an id of editInPlace. When you roll your cursor over the div, the background changes to a pale yellow. Clicking the text will start some DOM (Document Object Model) magic resulting in the div being replaced by a textarea input &#8212; with the text to be edited inside.</p>
<p>Clicking the save button will send the new HTML over to a simple PHP script that does nothing more than print out the data it receives (via $_POST).</p>
<p>In a real world application you would add in some additional safety checks, and then update your database with the new information and send back information that tells jQuery if the changes were successful.</p>
<p>But in this example, all changes are successful, the same information sent to the PHP script comes back to the jQuery code and is show in a simple window alert.</p>
<h3>Explanation</h3>
<p>The way I kick things off should be very familiar by now. Remember, if you don&#8217;t want to use the jQuery document.ready function then feel free to throw in your own init() function.</p>
<pre>
$(document).ready(function(){
setClickable();
});
</pre>
<p>So the first thing that happens is that the setClickable() function is fired. This function does the following:</p>
<p>Looks for the div with id=&#8221;editInPlace&#8221; and tells jQuery to do something when the div is clicked.</p>
<pre>
function setClickable() {
$('#editInPlace').click(function() {
</pre>
<p>Grabs the html inside the div using jQuery&#8217;s html() function. This html is wrapped inside of some more html that will make up the textarea and buttons for save and cancel.</p>
<pre>
var textarea = '&lt;div&gt;&lt;textarea rows=&quot;10&quot; cols=&quot;60&quot;&gt;'+$(this).html()+'&lt;/textarea&gt;';
var button = '&lt;div&gt;&lt;input type=&quot;button&quot; value=&quot;SAVE&quot;
class=&quot;saveButton&quot; /&gt; OR &lt;input type=&quot;button&quot; value=&quot;CANCEL&quot;
class=&quot;cancelButton&quot; /&gt;&lt;/div&gt;&lt;/div&gt;';
var revert = $(this).html();
</pre>
<p>The same html found within the div with id=&#8221;editInPlace&#8221; is assigned to a variable called &#8220;revert&#8221;. This will be used in the event the cancel button is used.</p>
<pre>
var revert = $(this).html();
</pre>
<p>jQuery&#8217;s DOM function &#8220;after&#8221; is used to place this new textarea html after the div we&#8217;ve targeted. I immediately chain another method to this (to save space) and tell jQuery to remove the div.</p>
<pre>
$(this).after(textarea+button).remove();
</pre>
<p>Using jQuery, I target the save and cancel button by using their class names. I instruct jQuery to trigger my final function &#8220;saveChanges&#8221; when either button is clicked. I close out the function that tells jQuery what to do when the div is clicked, but I do not put an apostrophe at the end because I want to chain more methods onto this div.</p>
<pre>
$('.saveButton').click(function(){saveChanges(this, false);});
$('.cancelButton').click(function(){saveChanges(this, revert);});
})
</pre>
<p>I chain a simple mouseover and mouseout to my code which tells jQuery to add and remove a class when a cursor rolls over the div we&#8217;ve targeted (id=&#8221;editInPlace&#8221;).</p>
<pre>
.mouseover(function() {
$(this).addClass("editable");
})
.mouseout(function() {
$(this).removeClass("editable");
});
};//end of function setClickable
</pre>
<p>Function &#8220;saveChanges&#8221; will take the button object for the first variable and the cancel variable should either be false or contain the html I stored in the &#8220;revert&#8221; variable.</p>
<pre>
function saveChanges(obj, cancel) {
</pre>
<p>If &#8220;cancel&#8221; is false then I&#8217;m telling this function to save the changes by sending the html over to the php script. I grab the html within the textarea by using some of the DOM functions available through jQuery: parent() and siblings().</p>
<pre>
if(!cancel) {
var t = $(obj).parent().siblings(0).val();
</pre>
<p>DOM basics are beyond the scope of this tutorial, but I&#8217;m basically telling jQuery &#8220;The obj (save button) has a parent (a div)&#8230; go find it. This object has one or more objects on the same level of the DOM tree&#8230; I want the first one. And grab the value of that object.&#8221;</p>
<p>(On second thought&#8230; if you aren&#8217;t familiar with DOM style of coding, then my explanation probably didn&#8217;t make much sense to you. I suggest Googling &#8220;DOM javascript&#8221; or something similar.&#8221;)</p>
<p>This html is assigned to the &#8220;t&#8221; variable and now it&#8217;s time to send it via POST over to test2.php.</p>
<pre>
$.post("test2.php",{
  content: t
},function(txt){
alert( txt);
});
}
</pre>
<p>If cancel has a value, then it should be html stored originally in the &#8220;revert&#8221; variable. So, at this point, I want the &#8220;t&#8221; variable to be set to the original html.</p>
<pre>
else {
var t = cancel;
}
</pre>
<p>The next step is to use the DOM functions within the jQuery javascript library to place a new div, with the &#8220;editInPlace&#8221; id, after the div containing the textarea&#8230; and then remove the div containing the textarea.</p>
<pre>
$(obj).parent().parent().after('&lt;div id=&quot;editInPlace&quot;&gt;'+t+'&lt;/div&gt;').remove() ;
</pre>
<p>In a nutshell, this tells jQuery &#8220;Go backwards on the DOM branches two moves. Place this HTML after the object found at that location, and then remove the object.&#8221;</p>
<p>Finally, we call the setClickable function again and close out the saveChanges() function. The purpose of recalling the setClickable() function is to reset the onMouseover, onMouseout, and onClick events.</p>
<pre>
setClickable();
}
</pre>
<h3>Second Example</h3>
<p>The second one is very similar but a little more complex.</p>
<p><a href="http://15daysofjquery.com/examples/jqueryEditInPlace/demo.php" target="_blank">Edit In Place With Ajax 2</a></p>
<p>Instead of one large div, this example turns every P tag into its own editable region. </p>
<p>The difficulty comes when you want to send the data to a server side script and target the correct P tag for updating in the database.</p>
<p>The solution I came up with is to number each P tag and send this information over to the PHP code. What you see in the alert box is that the PHP code &#8220;knows&#8221; which P tag is to be changed.</p>
<h3>Known Issues</h3>
<p>If you used something similar in a real application then you&#8217;d want to verify that the changes were made before telling jQuery to update the DOM with the new html.</p>
<p>For this demonstration there is no interaction with a database and so I skipped this step.</p>
<p>[tags]javascript, AJAX, AHAH, jQuery, DOM, scripting[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/edit-in-place-with-ajax-using-jquery-javascript-library/15/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Quick and Dirty AJAX</title>
		<link>http://15daysofjquery.com/quick-and-dirty-ajax/14/</link>
		<comments>http://15daysofjquery.com/quick-and-dirty-ajax/14/#comments</comments>
		<pubDate>Fri, 09 Jun 2006 14:04:01 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/quick-and-dirty-ajax/14/</guid>
		<description><![CDATA[I&#8217;m trying something a little different today. It took me a while to figure out why I couldn&#8217;t open a free account with YouTube for about 3 weeks but now that it&#8217;s all straightened out I thought I&#8217;d upload a video where I walk you through some of the basic ways you could use jQuery [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying something a little different today. It took me a while to figure out why I couldn&#8217;t open a free account with YouTube for about 3 weeks but now that it&#8217;s all straightened out I thought I&#8217;d upload a video where I walk you through some of the basic ways you could use jQuery to add AJAX functionality to your site.</p>
<p>The video is short because my understanding of YouTube is that I have to limit the file to 10 minutes.  Not everything I&#8217;ve said in the tutorial is 100% correct.  There are minor mistakes such as the part where I call cgi a &#8220;server side script&#8221; when it would be more accurate to say &#8220;server side language&#8221;. </p>
<p>Cut me some slack&#8230; woodya?</p>
<h3>Is It AJAX, or AHAH, or AXAH?</h3>
<p>What you&#8217;re going to see is really more AHAH than true AJAX. </p>
<p>The difference? The X in AJAX is for XML. More often than not you can grab chunks of text or javascript from a separate file without going through the hassle of messing around with XML. Here&#8217;s a better description of <a href="http://microformats.org/?p=67">AJAX vs. AHAH</a>.</p>
<p>As for AXAH&#8230; I&#8217;ll leave that to <a href="http://codylindley.com/Javascript/237/axah-asynchronous-xhtml-and-http-crawl-before-you-ajax">Cody Lindley</a> to explain. His article is a good read, you should check it out if you want some more background on the basic concepts of workable AJAX.</p>
<h3>The Tutorial</h3>
<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/XdUFjAvOPU0"></param><embed src="http://www.youtube.com/v/XdUFjAvOPU0" type="application/x-shockwave-flash" width="425" height="350"></embed></object></p>
<p>Here&#8217;s the page on the <a href="http://jquery.com/demo/ajax/" target="_blank">jQuery site</a> where I run through the examples. The link opens in a new browser window.</p>
<p>[tags]AJAX, AHAH, AXAH, Cody Lindley, jQuery, javascript[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/quick-and-dirty-ajax/14/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rounded Corners With Javascript (jQuery)</title>
		<link>http://15daysofjquery.com/wrap-it-up-pretty-corners/13/</link>
		<comments>http://15daysofjquery.com/wrap-it-up-pretty-corners/13/#comments</comments>
		<pubDate>Mon, 05 Jun 2006 16:07:28 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/wrap-it-up-pretty-corners/13/</guid>
		<description><![CDATA[Yesterday at 5:15 PM, I was jones-ing for my quick email fix after being away from the computer for almost 48 hours so I fired up Thunderbird and instantly grabbed a few RSS feeds I subscribe to. (On the weekends I&#8217;m swamped with home renovation projects and all my free time is spent with friends [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday at 5:15 PM, I was jones-ing for my quick email fix after being away from the computer for almost 48 hours so I fired up Thunderbird and instantly grabbed a few RSS feeds I subscribe to. (On the weekends I&#8217;m swamped with home renovation projects and all my free time is spent with friends and family&#8230; AWAY from the computer)</p>
<p>My new &#8220;buddy&#8221; Dustin Diaz (who included a reference to me and this site in his most recent audioblog) posted an edgy &#8220;take-it-or-leave-it&#8221; kind of post called <a href="http://www.dustindiaz.com/enough-with-corners/">&#8220;Enough With Rounded Corners&#8221;.</a></p>
<p>So I checked out this new resource for rounded corners and saw that the html would be perfect for an impromptu tutorial on jQuery - combining the wrap(), prepend(), and append() functions.</p>
<p>Here&#8217;s the html markup that we&#8217;re going to use as our starting point:</p>
<pre>
&lt;div class=&quot;dialog&quot;&gt;
 &lt;div class=&quot;hd&quot;&gt;
  &lt;div class=&quot;c&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
 &lt;div class=&quot;bd&quot;&gt;
  &lt;div class=&quot;c&quot;&gt;
&lt;div class=&quot;s&quot;&gt;
  &lt;-- main content goes here --&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
 &lt;div class=&quot;ft&quot;&gt;
  &lt;div class=&quot;c&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>So, how would we take this html, and use jQuery to clean up the code?</p>
<p>Well, first we need a &#8220;hook&#8221; - a unique html element, or an id, or a class name - to tell jQuery to target.</p>
<p>The solution I&#8217;m gunning for will remove <strong>all </strong>of the divs you see above. Therefore, I think a great &#8220;hook&#8221; would be a simple div with either a unique id or class name.</p>
<p>Let&#8217;s try this:</p>
<pre>
&lt;div class=&quot;roundbox&quot;&gt;
  &lt;-- main content goes here --&gt;
  &lt;/div&gt;
</pre>
<p>Next step&#8230; we use jQuery to add in our html code:</p>
<pre>
$(document).ready(function(){ $(&quot;div.roundbox&quot;) .wrap('&lt;div
        class=&quot;dialog&quot;&gt;'+
        '&lt;div class=&quot;bd&quot;&gt;'+
        '&lt;div class=&quot;c&quot;&gt;'+
        '&lt;div class=&quot;s&quot;&gt;'+
        '&lt;/div&gt;'+
        '&lt;/div&gt;'+
        '&lt;/div&gt;'+
        '&lt;/div&gt;');
});
</pre>
<h3>Where Are The Other Divs?</h3>
<p>Look closely at the code above and you&#8217;ll see that all of the divs fit nicely inside of each other and also <strong>wrap </strong>nicely around the content that will go inside our rounded box we&#8217;ll soon create.</p>
<p><em>You should also notice that I&#8217;ve left out quite a bit of the markup from the original. </em>That&#8217;s because the wrap() function in jQuery needs perfectly nested divs in order to work.</p>
<p>Specifically, I&#8217;ve left out these two parts:</p>
<pre>
&lt;div class=&quot;hd&quot;&gt;&lt;div class=&quot;c&quot;&gt;&lt;/div&gt;&lt;/div&gt;
</pre>
<pre>
&lt;div class=&quot;ft&quot;&gt;&lt;div class=&quot;c&quot;&gt;&lt;/div&gt;&lt;/div&gt;
</pre>
<h3>Append and Prepend All At Once</h3>
<p>If you notice, the parts that I left out go just inside, but at the beginning and at the end of the class=&#8221;dialog&#8221; div. This is a perfect opportunity to use append and prepend functions of jQuery and chain them together.</p>
<pre>
$('div.dialog').prepend('&lt;div class=&quot;hd&quot;&gt;'+
        '&lt;div class=&quot;c&quot;&gt;&lt;/div&gt;'+
        '&lt;/div&gt;')
.append('&lt;div class=&quot;ft&quot;&gt;'+
        '&lt;div class=&quot;c&quot;&gt;&lt;/div&gt;'+
        '&lt;/div&gt;');
</pre>
<h3>Example And Code</h3>
<p>I&#8217;ve put a <a href="http://15daysofjquery.com/examples/rounded/demo.php">Rounded Corners with jQuery example</a> online for you to see. Be sure to view the source code because I want you to see how clean the html looks when all the javascript and CSS is packaged off into separate files.</p>
<p>The code comes from an <a href="http://www.schillmania.com/content/entries/2006/04/more-rounded-corners/">article on Schillmania</a> and that&#8217;s where I would recommend <a href="http://www.schillmania.com/projects/dialog/">grabbing the zip file with the image slices</a> that make the rounded corners so pretty.</p>
<h3>Rounded Corners Without Images</h3>
<p>There are many other ways to create rounded corners - some involving no images whatsoever.</p>
<p>On the <a href="http://jquery.com">jQuery site</a> there&#8217;s a <a href="http://methvin.com/jquery/jq-corner-demo.html">plugin for making rounded corners</a> without images. It&#8217;s not for everyone (or every application) but worth checking out. Don&#8217;t ask me to break down the code because it&#8217;s pretty intense and chok full of trig functions that I am a little rusty on.</p>
<p>But look at how nice the code looks (using the plugin):</p>
<pre>
	$(document).bind("load", function(){
		$("#box1").corner();
	});
</pre>
<p>[tags]rounded corners, javascript, jQuery, DOM, CSS, Dustin Diaz, Schillmania[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/wrap-it-up-pretty-corners/13/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Style Sheet Switcheroo</title>
		<link>http://15daysofjquery.com/style-sheet-switcheroo/12/</link>
		<comments>http://15daysofjquery.com/style-sheet-switcheroo/12/#comments</comments>
		<pubDate>Fri, 02 Jun 2006 14:26:25 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/style-sheet-switcheroo/12/</guid>
		<description><![CDATA[The first time I saw a style sheet switcher I was either reading A List Apart or Simple Bits, both excellent sites you should visit if you are serious about design.
Since then, I&#8217;ve seen many different methods for allowing a visitor to switch a stylesheet with a click of a mouse. But recently I came [...]]]></description>
			<content:encoded><![CDATA[<p>The first time I saw a style sheet switcher I was either reading A List Apart or Simple Bits, both excellent sites you should visit if you are serious about design.</p>
<p>Since then, I&#8217;ve seen many different methods for allowing a visitor to switch a stylesheet with a click of a mouse. But recently I came across a <a href="http://www.kelvinluck.com/article/switch-stylesheets-with-jquery">short example</a> of how to do it with jQuery.</p>
<p>I want to show you this example and walk you through it because it not only gives another fine example of the short code you can write with jQuery but also too illustrate some of the more advanced features of the jQuery javascript library.</p>
<h3>First, The Code</h3>
<pre>
$(document).ready(function()
{
        $('.styleswitch').click(function()
        {
                switchStylestyle(this.getAttribute("rel"));
                return false;
        });
        var c = readCookie('style');
        if (c) switchStylestyle(c);
});

function switchStylestyle(styleName)
{
        $('link[@rel*=style]&#8216;).each(function(i)
        {
                this.disabled = true;
                if (this.getAttribute(&#8217;title&#8217;) == styleName) this.disabled = false;
        });
        createCookie(&#8217;style&#8217;, styleName, 365);
}
</pre>
<p>What I&#8217;ve left out of the demonstration are the functions you&#8217;ll see later for creating and reading the cookies.</p>
<h3>Familiar Ground</h3>
<pre>
$(document).ready(function()
{
        $('.styleswitch').click(function()
</pre>
<p>The beginning of the code tells jQuery <strong>&#8220;As soon as possible, get all elements with the class name of <em>styleswitch</em> and fire off a function when the element is clicked&#8221;.</strong></p>
<p>So far so good.</p>
<p>When these chosen elements are clicked the switchStylestyle function will be called. So that&#8217;s where we turn our attention next.</p>
<h3>What In The World?</h3>
<p>The first time I really looked closely at this I was stumped:</p>
<pre>
        $('link[@rel*=style]&#8216;).each(function(i)
        {
</pre>
<p>After searching the web and coming up empty handed I contacted John Resig, the creator of jQuery, and asked him for some hints.</p>
<p>He directed me to <a href="http://jquery.com/docs/CSS/">some pages</a> on the jQuery site that explain some of the <a href="http://jquery.com/docs/XPath/">more advanced</a> ways that jQuery can be used to find and manipulate elements on a page.</p>
<p>If you read the <a href="http://jquery.com/docs/CSS/">short explanations and examples here</a> you&#8217;ll soon see that this mysterious line of code tells jQuery <strong>&#8220;Find all link elements with a <em>rel</em> attribute containing the string &#8217;style&#8217;&#8221;</strong>.</p>
<p>Huh?</p>
<p>Let&#8217;s look at how we would create a page with one main stylesheet and two alternate ones:</p>
<pre>
 &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;styles1.css&quot;
  title=&quot;styles1&quot; media=&quot;screen&quot; /&gt;
  &lt;link rel=&quot;alternate stylesheet&quot; type=&quot;text/css&quot; href=&quot;styles2.css&quot;
  title=&quot;styles2&quot; media=&quot;screen&quot; /&gt;
  &lt;link rel=&quot;alternate stylesheet&quot; type=&quot;text/css&quot; href=&quot;styles3.css&quot;
  title=&quot;styles3&quot; media=&quot;screen&quot; /&gt;
</pre>
<p>Notice how all of the links to the stylesheets have a <strong>rel</strong> attribute with <em>&#8220;style&#8221;</em> somewhere between the quotation marks.</p>
<p>So, in short, this code is telling jQuery to target all of the stylesheet links in the page.</p>
<h3>What Next?</h3>
<p>The <strong>each()</strong> function loops through <em>each</em> of the stylesheet links and performs the operations spelled out in the next few lines of code:</p>
<pre>
                this.disabled = true;
                if (this.getAttribute('title') == styleName) this.disabled = false;
</pre>
<p><strong>&#8220;Disable every stylesheet link but then un-disable any link where the &#8220;title&#8221; attribute is the same as the value passed to the switchStylestyle function&#8221;</strong></p>
<p>That&#8217;s a mouthful too, but it&#8217;s really not that tough.</p>
<p>What we&#8217;re doing is matching the <strong>rel</strong> attribute of the links on our page (the clickable links for switching the stylesheets) with the <strong>title</strong> attribute of the stylesheets (and alternates) available to us.</p>
<p>When one of the clickable links is clicked, a function is called, which finds all the stylesheets, disables all of them, and then turns one back on&#8230; the one where the title of the stylesheet link matches the rel attribute of the link clicked.</p>
<p>Whew!</p>
<h3>Full Code and Demos</h3>
<p>Since <a href="http://www.kelvinluck.com/article/switch-stylesheets-with-jquery">Kelvin Luck</a> already created the code, no need for me to replicate it here.</p>
<p><a href="http://www.kelvinluck.com/assets/jquery/styleswitch/">Demo</a></p>
<p>Code - I won&#8217;t link directly to the zip, since that&#8217;s sometimes seen as rude. Go to <a href="http://www.kelvinluck.com/article/switch-stylesheets-with-jquery">this page</a> and at the bottom is a link to the zip.</p>
<h3>Compare to Other Code</h3>
<p>I believe ol&#8217; Kelvin got his inspiration from <a href="http://www.ecst.csuchico.edu/~bertucci/csci245/styleswitcher.htm">this site</a> where you&#8217;ll see that to do this without jQuery is a little bit more complicated and you don&#8217;t get all the benefits of Kelvin&#8217;s code - namely the long term memory of stylesheet chosen.</p>
<p>[tags]jQuery, javascript, DOM, cookie, stylesheet, css, alternate stylesheets[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/style-sheet-switcheroo/12/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Safer Contact Forms Without CAPTCHA&#8217;s</title>
		<link>http://15daysofjquery.com/safer-contact-forms-without-captchas/11/</link>
		<comments>http://15daysofjquery.com/safer-contact-forms-without-captchas/11/#comments</comments>
		<pubDate>Tue, 30 May 2006 13:42:59 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/safer-contact-forms-without-captchas/11/</guid>
		<description><![CDATA[Here&#8217;s a subject that&#8217;s close to my heart: secure contact forms.
As I mentioned in a previous tutorial, one common use of contact forms is to help visitors communicate with you without exposing your email address to the email harvesting software used by spammers.
But when it comes to spam, hardly anything&#8217;s worse than an insecure contact [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a subject that&#8217;s close to my heart: secure contact forms.</p>
<p>As I mentioned in a previous tutorial, one common use of contact forms is to help visitors communicate with you without exposing your email address to the email harvesting software used by spammers.</p>
<p>But when it comes to spam, hardly anything&#8217;s worse than an insecure contact form. Imagine getting a nasty note from your web hosting company that your site has been used to send out massive amounts of email about black market erection medication and, oh by the way, your site is offline until you get it fixed - thank you very much.</p>
<p>So what I&#8217;m going to show you today is a simple method for adding an extra layer of security to ANY contact form on your site - even if you don&#8217;t use my super secure and wonderfully flexible <a href="http://ultimateformmail.com">Ultimate Form Mail</a>.</p>
<h3>The Situation</h3>
<p>You notice that spammers have been remotely probing your contact forms for vulnerabilities&#8230; and you want them to quit.</p>
<h3>The Problem</h3>
<p>You don&#8217;t want to use CAPTCHA&#8217;s (Completely Automated Public Turing Test to Tell Computers and Humans Apart) because you <em>just know</em> that requiring your visitors to read squiggly letters and numbers just to send you a message is going to <em>suppress </em>communication - not encourage it.</p>
<p><img src="http://15daysofjquery.com/images/CAPTCHA.png" border="0" /></p>
<p>Bottom line: you want to make life tough for the Bad Guys and super simple for the Good Guys. </p>
<h3>The Solution</h3>
<p>You&#8217;re going to use jQuery to add some hidden tag information to the contact form when the page loads. When the form is sent to the processor, you&#8217;ll use some simple PHP code to verify the following:</p>
<ul>
<li>The hidden tag is present</li>
<li>The hidden tag&#8217;s value matches a &#8216;token&#8217; stored as a cookie by your visitor&#8217;s browser</li>
<li>The timestamp for the hidden tag hasn&#8217;t expired</li>
</ul>
<p>In other words, your visitor will have a limited amount of time (specified by you) to fill in the form and send it. And if a spammer tries to post information to your form processor remotely they&#8217;re going to hit a big fat roadblock. Do not pass go, do not collect $200.</p>
<p>What I&#8217;m going to share with you is a modified concept I read from a very smart fellow named <a href="http://shiflett.org/">Chris Shiflett</a>. He&#8217;s a security expert on all sorts of issues that PHP programmers can come across if they&#8217;re not careful.</p>
<h3>The Tutorial</h3>
<p>I got great responses from the tutorial for Table Striping Made Easy so I&#8217;ve decided to do another &#8220;walk through&#8221; tutorial with screen grabs. It&#8217;s a little time consuming, but hey, you&#8217;re worth it.</p>
<p><a href="http://15daysofjquery.com/examples/contact-forms/"><strong>Tutorial on Safer Contact Forms Without CAPTCHA&#8217;s</strong></a></p>
<p><a href="http://15daysofjquery.com/examples/contact-forms/code/demo.php"><strong>Demo</strong></a></p>
<p><a href="http://15daysofjquery.com/examples/contact-forms/code/"><strong>Code</strong></a></p>
<h3>Silver Bullet?</h3>
<p>&#8220;So now my forms are 100% secure and I can use <em>Generic Free Contact Form Processor With Sloppy Code</em> and feel safe?&#8221;</p>
<p>Uh&#8230; no.</p>
<p>This security concept is based on a key assumption:</p>
<p><strong>Spammers would prefer to go after the &#8220;low hanging fruit&#8221; than spend all day trying to crack a tricky contact form.</strong></p>
<p>Now listen carefully, dear friend:</p>
<p>This technique, although strong, is <em>not</em> a cure for a weak form processor.</p>
<p>My attitude towards securing a contact form is to use multiple methods on both the server side and the client side so that a spammer is going to have to invest an enormous amount of resources to even come close to succeeding with their evil plot.</p>
<p>I view the client side protection as analogous to posting a sticker on the windows of a home to indicate that the house is wired with an alarm. Thieves know to look for stickers, dogs in the yard, lights on the exterior of a home, and other signs of a well guarded house. They&#8217;re looking for high payoff with minimal work and risk.</p>
<p>In other words, if you can thwart 99% of attacks before they really get started and you can do it so easily why wouldn&#8217;t you? That&#8217;s what this technique does.</p>
<p>But it&#8217;s not a silver bullet cure for a crappy form processor.</p>
<p>[tags]jQuery, javascript, DOM, spam, spam prevention, contact form, Shiflett, AJAX, form processor[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/safer-contact-forms-without-captchas/11/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wrap It Up - Lazy Man&#8217;s HTML Generation With jQuery</title>
		<link>http://15daysofjquery.com/wrap-it-up-lazy-mans-html-generation-with-jquery/10/</link>
		<comments>http://15daysofjquery.com/wrap-it-up-lazy-mans-html-generation-with-jquery/10/#comments</comments>
		<pubDate>Tue, 30 May 2006 03:05:58 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/wrap-it-up-lazy-mans-html-generation-with-jquery/10/</guid>
		<description><![CDATA[The Memorial Day weekend is coming to a close - I&#8217;ve been away from the computer for almost 48 hours (gasp!) and I want to get another jQuery tutorial up and online quickly.
I&#8217;m dying to do the write up for &#8220;Edit In Place the Jquery Way&#8221; and &#8220;Multiple File Upload Magic&#8221; but the code for [...]]]></description>
			<content:encoded><![CDATA[<p>The Memorial Day weekend is coming to a close - I&#8217;ve been away from the computer for almost 48 hours (gasp!) and I want to get another jQuery tutorial up and online quickly.</p>
<p>I&#8217;m dying to do the write up for &#8220;Edit In Place the Jquery Way&#8221; and &#8220;Multiple File Upload Magic&#8221; but the code for both is a little more in depth and it just feels like I should tackle a few of the easier tutorials in the beginning.</p>
<p>So here goes - </p>
<p>Ever since making the switch away from table layouts for my websites in favor of all CSS (it must be two and a half years or more now) I&#8217;ve been consuming all the information I can find on the subject.</p>
<p>Way back in May of 2004 (ancient history) <a href="http://www.alistapart.com/">A List Apart</a> had a <a href="http://www.alistapart.com/articles/onionskin/">great tutorial on creating drop shadows (Onion Skinned Drop Shadows)</a> for any image, regardless of size.</p>
<p>The comments for the article are no longer available, but some of them echoed the sentiment from the editor&#8217;s note at the beginning of the tutorial. </p>
<blockquote><p>
Editorâ€™s Note: The techniques demonstrated in this tutorial are not for everyone. <strong>The design method works its magic by nesting divs that have no semantic or structural value.</strong> If that bothers you (and there are good reasons why it might), this is not the tutorial for you.
</p></blockquote>
<p><em>(Emphasis added by Jack)</em></p>
<h3>The Problem</h3>
<p>Some CSS techniques require &#8220;extraneous&#8221; markup because currently only one background image can be assigned per element.</p>
<p>For example:</p>
<p>Here is the html code used in the A List Apart tutorial:</p>
<pre>
&lt;div class=&quot;wrap1&quot;&gt;
&lt;div class=&quot;wrap2&quot;&gt;
&lt;div class=&quot;wrap3&quot;&gt;
&lt;img src=&quot;object.gif&quot; alt=&quot;The object casting a shadow&quot;
/&gt;
&lt;/div&gt;<
&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>All of those divs serve as &#8220;hooks&#8221; for background images that make up the drop shadow.</p>
<p>Woudn&#8217;t it be nice if we could trim down our source code to:</p>
<pre>
&lt;img src=&quot;object.gif&quot; class=&quot;dropshadow&quot; alt=&quot;The object casting a shadow&quot; /&gt;
</pre>
<p>Which leads us to&#8230;</p>
<h3>The Goal</h3>
<p>I&#8217;m going to show you how easy it is to remove extraneous markup from your html source code using jQuery. Using this method will keep your code cleaner and (more importantly) will make it future layout changes much easier.</p>
<h3>The Solution</h3>
<p>Here&#8217;s how jQuery attacks the problem.</p>
<pre>
$(document).ready(function(){
$(&quot;img.dropshadow&quot;)
.wrap(&quot;&lt;div class='wrap1'&gt;&lt;div class='wrap2'&gt;&quot; +
&quot;&lt;div class='wrap3'&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&quot;);
});
</pre>
<p>And then the images would be styled like so:</p>
<pre>
&lt;img src=&quot;object.gif&quot; class=&quot;dropshadow&quot; alt=&quot;The object casting a shadow&quot; /&gt;
</pre>
<h3>A Closer Look</h3>
<p><strong>$(document).ready()</strong> is jQuery&#8217;s version of window.onload()</p>
<p><strong>$(&#8221;img.dropshadow&#8221;)</strong> tells jQuery to find all images with the class name &#8220;dropshadow&#8221;. If you wanted to use an id instead, you could do something like <strong>$(&#8221;img#dropshadow&#8221;)</strong></p>
<p><strong>wrap()</strong> tells jQuery to use the DOM (Document Object <span style="text-decoration: line-through;">Method</span> Model) to wrap the images with the class=&#8221;dropshadow&#8221; in the html inside the parenthesis. </p>
<h3>The End Result</h3>
<p>Silly picture&#8230; but it&#8217;s the same one used in the original Onion Skinned Drop Shadows:</p>
<p><a href="http://15daysofjquery.com/examples/osds/">jQuery Drop Shadow Example</a></p>
<h3>Compare jQuery to Other Solutions</h3>
<p>From the <a href="http://jquery.com">jQuery</a> site there&#8217;s a link to the <a href="http://ajaxian.com/">Ajaxian</a> website where another javascript library was used to create the <a href="http://ajaxian.com/archives/onion-skinned-drop-shadows-with-javascript">Onion Skin Drop Shadow with javascript</a> and I think the amount of code and the complexity of the code speaks for itself. Personally, I would prefer jQuery (but you already guessed that, didn&#8217;t you?)</p>
<p>To be fair&#8230; no one library is perfect for every job or every coder. This tutorial really isn&#8217;t meant to prove that jQuery is the &#8220;One True&#8221; all purpose javascript library.</p>
<p>Try Prototype, Scriptaculous, YUI, Rico, Behaviour, Moo.fx and the dozens of others. If you find one that works better for you&#8230; then use it.</p>
<p>jQuery is a tool that spoke to me. I hope this tutorial has shown you one more useful way to use it.</p>
<h3>Related jQuery Tools</h3>
<p>jQuery makes it incredibly easy to manipulate the html generated by your visitor&#8217;s browser.</p>
<p>You should take a moment and <a href="http://jquery.com/docs/BaseDOM/">see what you can do with jQuery</a> using append(), prepend(), before(), after(), html(), and remove().</p>
<h3>Meatier Tutorials On the Way</h3>
<p>For degree of difficulty, today I scored a one or a two. But that&#8217;s okay because even though the concept is simple, it&#8217;s applicable to lots of situations you come across in your design and coding work.</p>
<p>And besides, regardless of when you read this tutorial, I posted it after a Memorial Day of fun in the sun on the beaches of Florida. I just put the family to bed and I still have sand on my feet.</p>
<p>Rest assured, before we get to the end of the <a href="http://15daysofjquery.com">15 Days of jQuery</a> you&#8217;re going to see some more advanced tutorials, examples, and code. </p>
<p>[tags]jQuery, javascript, DOM, drop shadow[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/wrap-it-up-lazy-mans-html-generation-with-jquery/10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Safer Mailto Links</title>
		<link>http://15daysofjquery.com/safer-mailto-links/8/</link>
		<comments>http://15daysofjquery.com/safer-mailto-links/8/#comments</comments>
		<pubDate>Thu, 25 May 2006 17:08:08 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/safer-mailto-links/8/</guid>
		<description><![CDATA[Rule number one when it comes to preventing spam: Don&#8217;t put a your email address in a mailto: link.
To fight the evil Legion of Spammers, web designers and programmers have come up with some creative solutions. Let&#8217;s take a quick look at the more common workarounds and the drawbacks (minor as they may be).
name [at-no-spam] [...]]]></description>
			<content:encoded><![CDATA[<p>Rule number one when it comes to preventing spam: Don&#8217;t put a your email address in a mailto: link.</p>
<p>To fight the evil Legion of Spammers, web designers and programmers have come up with some creative solutions. Let&#8217;s take a quick look at the more common workarounds and the drawbacks (minor as they may be).</p>
<h4>name [at-no-spam] website.com</h4>
<p>Problem: a link would be more convenient than typing in the address and some<br />
  will mistype.</p>
<h4>Contact forms</h4>
<p>Problem: you run the risk of having a spammer use your account to send their<br />
  mass emails (unless you use a really <a href="http://www.ultimateformmail.com/">secure formmail script</a>) and it&#8217;s overkill for situations<br />
  where you want visitors to just send a simple message.</p>
<h4>Javascript encryption</h4>
<p>Problem: your email is still sitting out in the open even if you use <a href="http://automaticlabs.com/products/enkoderform/">sophisticated<br />
  encryption</a> to mask it. And who wants to run off to a third party website and run a dozen email addresses through an encryption algorithm one at a time? Not me.</p>
<h4>Hiding behind a simple form</h4>
<p>(For an example, see <a href="http://simon.incutio.com/contact/">Simon Willison&#8217;s site</a> and the button that reads &#8216;Reveal my Address&#8217; near the top of the page.)</p>
<p>Problem: None that I can think of&#8230; but let&#8217;s see if we can improve on the<br />
  concept.</p>
<h3>A Possible Solution: AJAX</h3>
<p>The solution I propose will have a few advantages over some of the workarounds that we webdesigners currently use:</p>
<ul>
<li>Easy to implement</li>
<li>Easy to change</li>
<li>A little razzle-dazzle in the presentation</li>
<li>No need to use a third party tool to encrypt an email address</li>
<li>No email addresses sitting out in the open</li>
</ul>
<p>By the last point I suggest that email encryption devices rely on obfuscation to hide the email address and assume that spammers aren&#8217;t smart enough or determined enough to reverse engineer the code and then go about collecting any emails they find on the web that are encrypted using the same method. In practice, I think that email encryption is relatively safe but the fact remains that the email is sitting in the html source code.</p>
<h3>The Concept</h3>
<ol>
<li>Use jQuery to grab html content from a file on the server</li>
<li>The file containing the email addresses is mostly html (mailto links) with a simple protection mechanism thrown in for good measure</li>
</ol>
<h3>The Demos</h3>
<p>I&#8217;m going to start with an example that shows the email addresses when the visitor clicks a button or link and move towards an example where the email addresses appear on the page almost instantaneously.</p>
<p><strong><a href="/examples/mailto/demo1.php">On button click - instant</a></strong></p>
<p><strong><a href="/examples/mailto/demo2.php">On link click - fade in</a></strong></p>
<p><strong><a href="/examples/mailto/demo3.php">On page load  - fade in</a></strong></p>
<p><strong><a href="/examples/mailto/demo4.php">On page load - instant</a></strong></p>
<p>(*Note: by instant, I mean to say &#8220;no fancy effects&#8230; show the email addresses as fast as possible.)</p>
<h3>The Code</h3>
<p>This is released under a non-commercial creative commons license. Contact me if you want to use the code in a commercial product. I&#8217;m currently using it in a new <a href="http://cmslaunch.com">CMS for web designers</a> that I&#8217;m launching soon.</p>
<p>Get the code here (link to be added later)</p>
<h3>Why Is This Safer Than A Regular Mailto Link?</h3>
<p>The real problem with mailto links is that spammers can use automated software that searches the web to find them in the source code of your html. They most likely find you the same way Google does: by following links.</p>
<p>They&#8217;re lazy just like the rest of us. Therefore it&#8217;s unlikely that they&#8217;re surfing the web with a legal pad next to their keyboard, scribbling down lists of email addresses to spam. </p>
<p>View the source code of any of the demos and you will see that the email addresses are not in the html. </p>
<p>Is this a rock solid way to absolutely guarantee that you will never get spam and only receive pleasant emails from friendly web visitors&#8230; no.</p>
<p>But removing the email address from the source code, changing the secret phrase in the jQuery code, and changing the filename of the target file will probably give you a fair compromise between convenience for your visitors and security for your email address.</p>
<h3>One Final Note</h3>
<p>Take a close look at the code for the first three examples and you&#8217;ll see that I use the AJAX callback function to trigger the slideDown() and show() effects.</p>
<p>In other words, I don&#8217;t want jQuery starting the slideDown() effect until the information (html) has been received from the AJAX call. Posting the secret phrase to our simple server side script and then receiving the information back takes time.</p>
<p>Right way:</p>
<pre>
$(document).ready(function(){
$.post('mailtoInfo.php',{
  pass: "secret"
},function(txt){
  $('div.email').html(txt);
  $('div.email').slideDown("slow");
});
});
</pre>
<p>Wrong way:</p>
<pre>
$(document).ready(function(){
$.post('mailtoInfo.php',{
  pass: "secret"
},function(txt){
  $('div.email').html(txt);
});
 $('div.email').slideDown("slow");
});
</pre>
<p>[tags]jQuery, mailto, spam, AJAX[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/safer-mailto-links/8/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Affiliate Link Loveliness</title>
		<link>http://15daysofjquery.com/affiliate-link-loveliness/7/</link>
		<comments>http://15daysofjquery.com/affiliate-link-loveliness/7/#comments</comments>
		<pubDate>Tue, 23 May 2006 15:30:17 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/affiliate-link-loveliness/7/</guid>
		<description><![CDATA[Today&#8217;s tutorial is a quickie. I want to tackle something easy early on in the &#8220;15 Days&#8221; so that someone new to javascript can sink their teeth into a real world example without getting bogged down in code. 
The fact that I find myself desperately short on time today with deadlines looming certainly sealed the [...]]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s tutorial is a quickie. I want to tackle something easy early on in the &#8220;15 Days&#8221; so that someone new to javascript can sink their teeth into a real world example without getting bogged down in code. </p>
<p>The fact that I find myself desperately short on time today with deadlines looming certainly sealed the decision.</p>
<h3>The Goal</h3>
<p>We&#8217;re going to create a quick little snippet of code using jQuery that will convert and camouflage all of our affiliate links on a page.</p>
<h3>Why?</h3>
<p>Some affiliate marketers believe that there&#8217;s a segment of their audience that is savvy enough to spot an affiliate link and will avoid clicking through the link - typing the url directly into the browser to &#8220;cheat&#8221; the affiliate marketer out of their commission (assuming a purchase is made).</p>
<h3>The &#8220;Old&#8221; Way</h3>
<p>There are lots of ways affiliate marketers have devised to camouflage their links or to make it very difficult for someone to avoid clicking through their link. Some of these methods involve .htaccess and server side code.</p>
<p>But for the purpose of this tutorial I&#8217;m going to focus on some &#8220;old school&#8221; javascript:</p>
<pre>
&lt;a onMouseOver='window.status=&quot;http://www.merchant-url-here.com&quot;;
return true;' onMouseOut='window.status=&quot;Done&quot;; return true;'
 href=&quot;http://www.affiliate-url-here.com&quot;
target=&quot;_blank&quot;&gt;Link Text Here&lt;/a&gt;
</pre>
<p>This code is designed to show the generic url in the status bar of the browser when  a website visitor hovers their cursor over the link. So instead of seeing www.website.com?aff=123 they see www.website.com</p>
<h3>The Problem</h3>
<p>You&#8217;re an active affiliate marketer with multiple links on multiple pages and you&#8217;re adding content at a frantic pace. Writing all this code gets tiresome. And putting javascript into each affiliate link will make updating your websites a nightmare if at some point down the road you decide to change something about the code and the way the links are displayed.</p>
<h3>The jQuery Solution</h3>
<p><strong>First step:</strong></p>
<p>We want the javascript to camouflage our links as soon as possible so we start with this:</p>
<pre>
&lt;script src=&quot;jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  $(document).ready(function(){
//code goes here
});
  &lt;/script&gt;
</pre>
<p>As soon as the DOM (Document Object Model) is ready, the code inside of the ready(function(){}) will start.</p>
<p><strong>Next</strong></p>
<p>We&#8217;re going to give all of our affiliate links a class name and a title. The class name will help jQuery scan the page and find all of the links we want changed, leaving all other links untouched. </p>
<p>The title will serve two purposes: when the cursor hovers over the link, a tiny tootip-like box will appear with the www.website.com url displayed and the same url information will display in the bottom of the browser window (Internet Explorer only).</p>
<pre>
&lt;p&gt;&lt;a href=&quot;http://www.affsite.com?id=123&quot; title=&quot;http://www.affsite.com&quot;
  class=&quot;affLink&quot;&gt;Super Duper Product&lt;/a&gt;&lt;/p&gt;
</pre>
<p><strong>Tell jQuery to Find Links With class=&#8221;affLink&#8221;</strong></p>
<pre>
$('a.affLink')
</pre>
<p><strong>Add A Mouseover Event</strong></p>
<pre>
$('a.affLink').mouseover(function(){window.status=this.title;return true;})
</pre>
<p>Simply put, this says &#8220;Find all links with class name affLink and onMouseover change the status of the browser (where link information is shown) to whatever you find in the title of the link.&#8221;</p>
<p>This does not work in FireFox (made fav browser) but it works for Internet Explorer (what most of the world uses - unfortunately). And in FireFox it just displays &#8216;Done&#8217;, or more accurately, moving the cursor over the link doesn&#8217;t have any effect on the status bar of the browser. I have not tested this in other browsers.</p>
<p><strong>Home Stretch - Mouseout</strong></p>
<p>jQuery lets us &#8220;chain&#8221; methods together like so:</p>
<pre>
$('a.affLink').mouseover(function(){window.status=this.title;return true;})
.mouseout(function(){window.status='Done';return true;});
</pre>
<p>This last bit of code tells jQuery to change the status bar of the browser back to &#8216;Done&#8217; when the cursor is no longer hovering over the link.</p>
<p>If chaining mouseover and mouseout is a little more than you want to tackle as you get used to jQuery then there&#8217;s nothing wrong with writing your code like so:</p>
<pre>
$('a.affLink').mouseover(function(){window.status=this.title;return true;});
$('a.affLink').mouseout(function(){window.status='Done';return true;});
</pre>
<p>It&#8217;s up to you.</p>
<p><strong>Put It All Together</strong></p>
<pre>
&lt;script src=&quot;jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function(){
$('a.affLink').mouseover(function(){window.status=this.title;return true;})
.mouseout(function(){window.status='Done';return true;});
});
&lt;/script&gt;
</pre>
<h3>Final Thoughts</h3>
<p>Some of you may be thinking this &#8220;Day&#8221; to be a bit simplistic. Others may have a difficult time seeing the point of the tutorial because you&#8217;re not an affiliate marketer.</p>
<p>In <a href="/#comingUp">&#8220;Days&#8221; to come</a> you&#8217;ll see me tackle issues that get more involved and apply to almost anyone with a website - whether you monetize your traffic or not.</p>
<p>[tags]affiliate marketing, affiliate links, DOM, javascript, jQuery[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/affiliate-link-loveliness/7/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Table Striping Made Easy</title>
		<link>http://15daysofjquery.com/table-striping-made-easy/5/</link>
		<comments>http://15daysofjquery.com/table-striping-made-easy/5/#comments</comments>
		<pubDate>Mon, 22 May 2006 01:01:40 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/table-striping-made-easy/5</guid>
		<description><![CDATA[I&#8217;ve prepared a step by step demonstration to take someone else&#8217;s well written javascript and reduce it down to 5 lines or less. At the same time you&#8217;ll see how I make it a little more flexible and useful.
Take a look at &#8220;Stripe your tables the OO way&#8221; by Matthew Pennell. His code is clean [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve prepared a <a href="/examples/zebra/" target="_blank">step by step demonstration</a> to take someone else&#8217;s well written javascript and reduce it down to 5 lines or less. At the same time you&#8217;ll see how I make it a little more flexible and useful.</p>
<p>Take a look at &#8220;<a href="http://www.thewatchmakerproject.com/journal/309/stripe-your-tables-the-oo-way">Stripe your tables the OO way</a>&#8221; by Matthew Pennell. His code is clean and concise. And it&#8217;s an improvement over <a href="http://www.alistapart.com/articles/zebratables">a past article from A List Apart</a>.</p>
<p>But with the help of jQuery, I think we can do better.</p>
<p>The concept is to create stripes on a table and then have the background of each row change color when your cursor rolls over.</p>
<p><img src="/images/zebra1.png" border="0" /></p>
<h3>The Goal</h3>
<p>As I mentioned, Mathew&#8217;s code is quite good. It shows a level of skill that most part-time web geeks might find difficult to attain. It&#8217;s certainly above the head of someone just starting to roll up their sleeves and learn javascript.</p>
<p>How can jQuery help?</p>
<p>My mission is to show you that jQuery can make this task</p>
<ul>
<li>Easier to accomplish</li>
<li>Faster to load on the page</li>
<li>More flexible to use</li>
</ul>
<p>So what are you waiting for? <a href="examples/zebra/" target="_blank">Jump into the tutorial</a> and see how easy jQuery makes table striping.</p>
<p>[tags]jQuery, tutorial, javascript, DOM, table striping, zebra striping, AJAX[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/table-striping-made-easy/5/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Quicker Than window.onload</title>
		<link>http://15daysofjquery.com/quicker/4/</link>
		<comments>http://15daysofjquery.com/quicker/4/#comments</comments>
		<pubDate>Mon, 22 May 2006 01:01:10 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/quicker/4</guid>
		<description><![CDATA[Window.onload() is a workhorse of traditional javascript code. It&#8217;s been used by coders for years to kick start the client side magic as soon as everything on the page loads up.
But sometimes waiting for a page to load just isn&#8217;t quick enough.
A few large image files will quickly reveal that window.onload() can be painfully slow. [...]]]></description>
			<content:encoded><![CDATA[<p>Window.onload() is a workhorse of traditional javascript code. It&#8217;s been used by coders for years to kick start the client side magic as soon as everything on the page loads up.</p>
<p>But sometimes waiting for a page to load just isn&#8217;t quick enough.</p>
<p>A few large image files will quickly reveal that window.onload() can be painfully slow. So when I was creating a web app for internet marketers recently, I had to have something faster.</p>
<p>Some quick research into possible workarounds for the window.onload() issue brought me to some code by <a href="http://www.brothercake.com/site/resources/scripts/domready/" target="_blank">Brother Cake</a>. If all you need is a fast way to kick start your javascript then their code might be something to try.</p>
<p>But if you&#8217;re going to be doing some DOM (Document Object Model) javascript coding then why not use jQuery and have your cake and eat it too (horrible pun - sorry).</p>
<p>jQuery has a handy little function that launches your javascript as soon as the Document Object Model is ready&#8230; which happens before the page has finished loading.</p>
<pre>$(document).ready(function(){
  // Your code here...
});</pre>
<p>You can use it to launch any kind of javascript you like. It doesn&#8217;t have to be reserved for jQuery style coding. And there&#8217;s nothing wrong with telling jQuery to launch several different functions at once. </p>
<p>Similar to many init() functions you may have seen before&#8230; just a lot faster.</p>
<p>You&#8217;ll see this code used again and again in the examples I give you on 15 Days of jQuery. </p>
<p>[tags]jQuery, DOM, javascript, window.onload[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/quicker/4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JQuery - What, Why, When, Where, Who</title>
		<link>http://15daysofjquery.com/about-jquery-library/3/</link>
		<comments>http://15daysofjquery.com/about-jquery-library/3/#comments</comments>
		<pubDate>Mon, 22 May 2006 00:50:20 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://15daysofjquery.com/quicker-than-windowonload/3</guid>
		<description><![CDATA[jQuery is an amazing javascript library that makes it easy to create wonderful web effects in just a few lines of code. As the website says, it makes javascript fun.

If you're thinking... "Boy, I need another javascript library like I need another hole in my head" then join the club. That's exactly what I thought when I first came across it.]]></description>
			<content:encoded><![CDATA[<h3>What</h3>
<p>jQuery is an amazing javascript library that makes it easy to create wonderful web effects in just a few lines of code. As the website says, it makes javascript fun.</p>
<p>If you&#8217;re thinking&#8230; &#8220;Boy, I need another javascript library like I need another hole in my head&#8221; then join the club. That&#8217;s exactly what I thought when I first came across it.</p>
<p>I had already used Moo.fx, Scriptaculous, TW-SACK, and Prototype. I had dabbled with RICO, Yahoo YUI, and other libraries.</p>
<p>Unlinke PHP, javascript does not come naturally to me&#8230; but I was doing my best to keep my head above water and keep up with all this AJAX madness.</p>
<p>So when I came across jQuery I thought &#8220;Yet another javascript library&#8230; no thanks.&#8221;</p>
<h3>Why</h3>
<p>So why did I change my mind about jQuery and why should you consider using it?</p>
<p>Simple. In just one glance at the source code of a page using jQuery you&#8217;ll see how easy it is to use, how much it accomplishes in so few lines of code, and how graceful it is.</p>
<p>My mind was opened one day when I stumbled across some code written with jQuery. Over morning coffee, I was flipping through the RSS feeds and reading my daily dose of web design blogs when I came across an example of javascript loveliness that used jQuery. Truth be told, the code on that site had some browser related bugs&#8230; but the concept was something I hadn&#8217;t seen before.</p>
<p>And the code&#8230;</p>
<p>The code looked almost simple. Like nothing I had seen before. It made sense.</p>
<p>I started reading through the documentation and was amazed to see how much could be done with so little extra code.</p>
<h3>When</h3>
<p>You should use jQuery when you need</p>
<ul>
<li>A small library that gives you&#8230;</li>
<li>Powerful control over the Document Object Model</li>
<li>With very little effort or work on your part</li>
</ul>
<p>Or&#8230;</p>
<ul>
<li>Quick access to AJAX</li>
<li>Without a lot of bloat (overhead - wasted code)</li>
<li>And some basic animation effects to spice things up</li>
</ul>
<p>But&#8230;</p>
<p>If you need super fancy effects for animation, drag and drop, and super smooth animation then you&#8217;ll probably want to use Prototype and one of the many great library created to enhance the effects.</p>
<h3>Where</h3>
<p>You can download the source code (10k) and some excellent tutorials at the jQuery website.</p>
<h3>Who</h3>
<p>jQuery was created by <a href="http://ejohn.org/" target="_blank">John Resig</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://15daysofjquery.com/about-jquery-library/3/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
