<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Komodo Media &#187; jQuery</title>
	<atom:link href="http://www.komodomedia.com/tags/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.komodomedia.com</link>
	<description>blog, webdesign, illustration &#38; newsk00l javascript</description>
	<lastBuildDate>Wed, 18 Jan 2012 14:43:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rogieking.com</title>
		<link>http://www.komodomedia.com/blog/2009/01/rogieking/</link>
		<comments>http://www.komodomedia.com/blog/2009/01/rogieking/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 17:42:15 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Icons]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Microformats]]></category>
		<category><![CDATA[xHTML]]></category>

		<guid isPermaLink="false">http://www.komodomedia.com/?p=806</guid>
		<description><![CDATA[<img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/01/rogieking_blog_main.jpg" alt=""/>

Just wanted to show y'all (Oh no, living in Montana is changing me - I said y'all) some of the new work that I have done. I really wanted an online business card that reflected my personality, aesthetically tight, narrow (I love narrow sites) and to the point...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.komodomedia.com/portfolio/#rogieking" title="View more information for Rogieking.com in the Portfolio"><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/01/rogieking_blog_main.jpg" alt=""/></a></p>
<p>Just wanted to show y&#8217;all (Oh no, living in Montana is changing me &#8211; I said y&#8217;all) some of the new work that I have done. I really wanted an online business card that reflected my personality, aesthetically tight, narrow (I love narrow sites) and to the point. I didn&#8217;t want any extra <a href="http://twitter.com/rogieking">twitter</a> streams, <a href="http://tumblr.com">tumblr</a>, <a href="http://posterous.com">posterous</a>, <a href="http://last.fm">last.fm</a> or any of that other social mumbo jumbo &#8211; A few links would suffice. </p>
<p>When building this site, I kept thinking &#8220;Audi&#8221; or a car with smooth wood and metal inside. Also, I wanted it to tie into the Komodo Media version 4 style with wood and dark colors.  I love the Apple profile icon (as does everyone and their dogs apparently), so I wanted to use that, but give it a twist to make it my own. I modified the Apple profile icon to have a backwards/sideways hat, which as some have pointed out to my deficit, I wear all the time.</p>
<p>Custom icons were and have always been very important to me, none of that mainstream stuff. So, I made me a few sweet icons. The best icons, I believe, are in the contact section, <a href="http://rogieking.com/#contact">so go check them out</a>! I have a few more social network icons to do in the <a href="http://rogieking.com/#networks">networks</a> area, so be watching for those.</p>
<p>Next, being XHTML Strict and usable was extremely important to me. You may have noticed that when JavaScript is turned off, the site becomes readable as a very tall card and when sections are clicked they moved to a named anchor, thus repositioning the browser to that area. That&#8217;s rad. When JavaScript is detected, my favorite library, <a href="http://jquery.com">jQuery</a> takes over and rocks a myriad of animations (hopefully not too many) and makes it all the more smooth. I added some cool nick-knacks such as anchor-section loading, which is a fancy way to say that the JavaScript detects the anchor loaded and loads the appropriate section.  Also check out the hover effect on the profile dude &#8211; it&#8217;s fun ;)</p>
<p>Last, I&#8217;ve used CSS tricks from CSS3 to add text shadows to give that inset/letterpress look and a ton of PNG transparent images. Enough already, <a href="http://rogieking.com">check it out online</a> or <a href="http://www.komodomedia.com/portfolio/#rogieking" title="View more information for Rogieking.com in the Portfolio">read more over in the portfolio</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2009/01/rogieking/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Web Designer’s Daily Digest</title>
		<link>http://www.komodomedia.com/blog/2009/01/web-designer%e2%80%99s-daily-digest/</link>
		<comments>http://www.komodomedia.com/blog/2009/01/web-designer%e2%80%99s-daily-digest/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 06:17:25 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tumblelog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[God]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[ronald jenkees]]></category>

		<guid isPermaLink="false">http://www.komodomedia.com/?p=559</guid>
		<description><![CDATA[Here's a few valuable links I've dug up over the course of the past couple of weeks, in absolutely no logical order. I prefer it that way.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a few valuable links I&#8217;ve dug up over the course of the past couple of weeks, in absolutely no logical order. I prefer it that way:</p>
<ul>
<li><strong><a href="http://textflow.com/">TextFlow</a> Online Word Processing</strong>
<p>Pretty interesting looking online flash-based word processor.</p>
</li>
<li><strong><a href="http://www.macupdate.com/info.php/id/25327/regexhibit">RegExhibit</a> OSX Regular Expression Editor</strong>
<p>The OSX Regular Expression editor and debugger I&#8217;ve been looking for.</p>
</li>
<li><strong><a href="http://www.housingworks.org/">Housing Works</a></strong> Beautiful design
<p>The design for this website is stunning. I love large background websites.</p>
</li>
<li><strong><a href="http://www.serie3.info/s3slider/demonstration.html">s3slider</a>  jQuery Sliding Image Captions</strong>
<p>A very cool solution for image captions that lay over an image and animate in.</p>
</li>
<li><strong><a href="http://www.ronaldjenkees.com/">Ronald Jenkees</a> Electronic music</strong>
<p>One of the most original sounding solo electronic artists out there. Check out <a href="http://www.ronaldjenkees.com/2008/08/16/stay-crunchy-youtube-jam/">&#8220;Stay Crunchy&#8221;</a>. I can&#8217;t wait for his new album!</p>
</li>
<li><strong><a href="http://www.inovat.com/">Inovat</a> Sweet Looking Portfolio</strong>
<p>Incredibly simple, yet sweet looking portfolio web design.</p>
</li>
<li><strong>Enable path view in OSX Finder</strong>
<p>Haven&#8217;t you always wanted to display the full path to the current folder in your Finder window? In terminal, enter the following command:</p>
<p><code>defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES</code>
<p>Next, enter the following code to restart your Finder:</p>
<p><code>killall Finder</code></li>
<li><strong><a href="http://www.creativeandlive.com/">Creative and Live</a> Tight Minimal Design</strong>
<p>Really clean and tight minimal design. I love the logo and subtlety.</p>
</li>
<li><strong><a href="http://spacecollective.org/">Space Collective</a> Dark Simple Design</strong>
<p>Beautiful dark website design. I love the typography, color scheme and the block-like grid.</p>
</li>
<li><strong><a href="http://www.carbonica.org/">Carbonica</a> Stunning hand-drawn style</strong>
<p>This site has taken hand-drawn to a new level, complete with hand-drawn icons, headings, navigation and a cool illustrative style.</p>
</li>
<li><strong><a href="http://tapbots.com/weightbot">Weightbot Website</a> Dark, smooth and metallic</strong>
<p>Weightbot for the iPhone/iPod was cool and so is it&#8217;s site. I love the dark, metallic, apple-like style. Gorgeous work by<a href="http://markjardine.com/"> Mark Jardine.</a></p>
</li>
<li><strong><a href="http://iamsecond.com/">I AM SECOND</a> Amazing, heart-felt stories</strong>
<p>I absolutely love real stories about what God has done in people&#8217;s lives. This site is awesome.</p>
</li>
<li><strong><a href="http://www.command-tab.com/2008/12/04/jquery-fling/"> jQuery Fling</a> Subscribe/Publish event model</strong>
<p><a href="http://www.command-tab.com/">Collin Allen </a> has written a sweet jQuery plug-in that makes it easy to code JavaScript events using a publisher/subscriber model very similar to Flash.</p>
</li>
<li><strong><a href="http://deepliquid.com/projects/Jcrop/">jCrop</a> jQuery Image Cropping</strong>
<p>Very smooth jQuery image cropping plugin.</p>
</li>
<li><strong>Smooth CSS Image Resizing in IE</strong>
<p>I can&#8217;t believe that I&#8217;ve never seen this until now. Finally, bicubic interpolation for Internet Explorer with only one CSS rule:</p>
<p><code>img {<br />
	-ms-interpolation-mode:bicubic;<br />
}</code></p>
<h4>Preview:</h4>
<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/01/css_ms_interpolation.jpg" alt="CSS MS Interpolation preview"/>
</li>
<li><strong><a href="http://hicksdesign.co.uk/journal/dropbox-leap-sitting-in-a-tree">Dropbox/Leap Scrapbooking</a> Killer online scrapbooking</strong>
<p>Jon Hicks has come up with a very sweet way of scrapbooking all of those screenshots that you&#8217;ve been compiling over the times. I think I&#8217;ll actually use this one.</p>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2009/01/web-designer%e2%80%99s-daily-digest/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>jQuery Feed Menus</title>
		<link>http://www.komodomedia.com/blog/2008/10/jquery-feed-menus/</link>
		<comments>http://www.komodomedia.com/blog/2008/10/jquery-feed-menus/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 05:33:04 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Nerdlab]]></category>
		<category><![CDATA[atom]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[freebies]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[RSS]]></category>

		<guid isPermaLink="false">http://www.komodomedia.com/?p=329</guid>
		<description><![CDATA[<img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2008/10/feed_menu_header.png" alt="Feed Menus" />
When feeds became popular, it worked to have one icon on your site to point your readers to your RSS or Atom feeds. As feeds are more prevalent in blogs and websites abroad, the presence of multiple feeds abound. Learn how to put a feed menu on your site.]]></description>
			<content:encoded><![CDATA[<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2008/10/feed_menu_header.png" alt="Feed Menus" /><script type="text/javascript" src="http://d2dnrmagaqciul.cloudfront.net/samples/feed_menu/feed_menu.js"></script></p>
<link rel="stylesheet" href="http://d2dnrmagaqciul.cloudfront.net/samples/feed_menu/feed_menu.css" type="text/css" media="all" />
<!--[if IE]>
<link rel="stylesheet" href="http://d2dnrmagaqciul.cloudfront.net/samples/feed_menu/feed_menu_ie.css" type="text/css" media="all" /><![endif]--></p>
<div class="post_info">
<ul>
<li>
<li><a class="download" href="http://www.komodomedia.comwp-content/uploads/2008/10/jquery_feed_menu.zip">Download Example</a></li>
<li><a class="preview" href="http://d2dnrmagaqciul.cloudfront.net/samples/feed_menu/index.html">Preview/Code</a></li>
<li><strong>Tested in:</strong></li>
<li>Safari 2/3 Mac/PC</li>
<li>Firefox 2/3 Mac/PC</li>
<li>Opera 9 Mac</li>
<li>Internet Explorer 7/8</li>
<li>Google Chrome</li>
<li><strong>No Support For:</strong></li>
<li>Internet Explorer 6</ul>
<p><small>If you are feelin&#8217; the love, <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&#038;business=rogie%40komodomedia%2ecom&#038;item_name=Donate%20a%20Java&#038;amount=4%2e00&#038;no_shipping=0&#038;no_note=1&#038;tax=0&#038;currency_code=USD&#038;lc=US&#038;bn=PP%2dDonationsBF&#038;charset=UTF%2d8">spot me a coffee!</a></small></p>
</div>
<p>When feeds became popular, it worked to have one icon on your site to point your readers to your RSS or Atom feeds. As feeds are more prevalent in blogs and websites abroad, the presence of multiple feeds abound.  I have a feed for <a href="http://feeds.feedburner.com/komodomedia">my blog</a>, <a href="http://feeds.feedburner.com/komodomedia_nerdlab">the nerdlab</a>, <a href="http://del.icio.us/rss/rogie">my bookmarks</a>, <a href="http://friendfeed.com/tingo">my friend feed</a> as well as <a href="http://twitter.com/statuses/user_timeline/9085252.rss">my twitter updates</a>.  That&#8217;s a butt-ton of feeds. </p>
<p>Browsers have come up with a smart way of offering this content to users and it is usually place somewhere by the location bar as shown below:</p>
<h3>Firefox 3 Feed Menu</h3>
<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2008/10/firefox_feed_menu.png" alt="Firefox 3 Feed Menu" /></p>
<h3>Safari 3 Feed Menu</h3>
<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2008/10/safari_feed_menu.png" alt="Safari 3 Feed Menu" /></p>
<p>With the click of a button, you can view all of the feeds available in the <code class="inline">&lt;head&gt;</code> of the document.  </p>
<p>But still, it&#8217;s nice to offer users an alternate way to get at your feeds, so typically you will see a feed icon lurking around a site somewhere. At times, you will see a list of two, three or more links to different feeds offered on a site.  Why not have an easy and standard way of offering your feeds via a nice, compact menu, just like in the location bar, but on your site?  Why I ask? Why?  </p>
<p>It&#8217;d be awesome to allow users to click your feed icon and be presented with a list of feeds to choose from. Hmmm, I want your twitter feed in Atom format or I&#8217;d like to subscribe to your blog feed in RSS format. Done.</p>
<h3>The jQuery Feed Menu</h3>
<p>Here&#8217;s how easy it is. I am going to plop one right here: <span id="jquery_feed_menu_example_1"></span><script type="text/javascript">
//<![CDATA[
var fm = new FeedMenu();fm.write('#jquery_feed_menu_example_1');
//]]&gt;
</script>.  Go ahead click it. You know you want to. This feed menu was created easily by the following snippet of code:</p>
<p><code>var fm = new FeedMenu();<br />
fm.write('#jquery_feed_menu_example_1');</code></p>
<p>Cool huh?  That piece of code finds all of your feeds in the <code class="inline">&lt;head&gt;</code> of your HTML document and makes them into a handy menu you can plop anywhere.  Here are some more examples:</p>
<h3>Atom Feeds</h3>
<p>Atom Feeds: <span id="jquery_feed_menu_example_2"></span><script type="text/javascript">//<![CDATA[
var fm2 = new FeedMenu('link' + String.fromCharCode(91) +'type*=atom' + String.fromCharCode(93));fm2.write('#jquery_feed_menu_example_2');
//]]&gt;
</script></p>
<h4>Code:</h4>
<p><code>var fm = new FeedMenu('link[type*=atom]');<br />
fm.write('#jquery_feed_menu_example_2');</code></p>
<h3>RSS Feeds</h3>
<p>RSS Feeds: <span id="jquery_feed_menu_example_3"></span><script type="text/javascript">//<![CDATA[
var fm3 = new FeedMenu('link' + String.fromCharCode(91) +'type*=rss' + String.fromCharCode(93));fm3.write('#jquery_feed_menu_example_3');
//]]&gt;
</script></p>
<h4>Code:</h4>
<p><code>var fm = new FeedMenu('link[type*=rss]');<br />
fm.write('#jquery_feed_menu_example_3');</code></p>
<h3>Different Theme Classes:</h3>
<p><span id="jquery_feed_menu_example_8"></span> Classic Orange<script type="text/javascript">//<![CDATA[
var fm8= new FeedMenu();
fm8.write('#jquery_feed_menu_example_8');
//]]&gt;
</script><br />
<span id="jquery_feed_menu_example_4"></span> Komodo Media v.4 Woodgrain <script type="text/javascript">//<![CDATA[
var fm4 = new FeedMenu(null,'wood');
fm4.write('#jquery_feed_menu_example_4');
//]]&gt;
</script><br />
<span id="jquery_feed_menu_example_5"></span> Komodo Media Azure<script type="text/javascript">//<![CDATA[
var fm5 = new FeedMenu(null,'azure');
fm5.write('#jquery_feed_menu_example_5');
//]]&gt;
</script></p>
<p><span style="background:#111;padding:1em 0.5em;margin-right:0.5em;" class="jquery_feed_menu_example_6"</span><span style="background:#666600;padding:1em 0.5em;margin-right:0.5em;" class="jquery_feed_menu_example_6"></span><span style="background:#663300;padding:1em 0.5em;margin-right:0.5em;" class="jquery_feed_menu_example_6"></span></span> Transparent on Dark (for dark backgrounds)<script type="text/javascript">//<![CDATA[
var fm6 = new FeedMenu(null,'trans_on_dark');
fm6.write('.jquery_feed_menu_example_6');
//]]&gt;
</script></p>
<p><span style="background:#DDD;padding:1em 0.5em;margin-right:0.5em;" class="jquery_feed_menu_example_7"></span><span style="background:#33FFFF;padding:1em 0.5em;margin-right:0.5em;" class="jquery_feed_menu_example_7"></span><span style="background:#FFCCFF;padding:1em 0.5em;margin-right:0.5em;" class="jquery_feed_menu_example_7"></span> Transparent on Light (for light backgrounds)<script type="text/javascript">//<![CDATA[
var fm7= new FeedMenu(null,'trans_on_light');
fm7.write('.jquery_feed_menu_example_7');
//]]&gt;
</script></p>
<h4>Code:</h4>
<p><code>/*<br />
*   @param 1: CSS link selector or array of JSON objects<br />
*   @param 2: Class Name: null, wood, azure, trans_on_dark, trans_on_light<br />
/*<br />
var fm = new FeedMenu(null,'wood'); //2nd param is class<br />
fm.write('#jquery_feed_menu_example'); </code></p>
<h3>Last, something custom</h3>
<p>Let&#8217;s say you don&#8217;t want the feed menu to find links for you. You want to provide them in code. Check this out: <span id="jquery_feed_menu_example_9"></span><script type="text/javascript">//<![CDATA[
var oCustomLinks = [ {title:'RSS Feed', href:"http://feeds.feedburner.com/komodomedia" },{title:'Subscribe with Bloglines', href:"http://www.bloglines.com/sub/http://feeds.feedburner.com/komodomedia" },{title:'Subscribe with Google Reader', href:"http://www.google.com/reader/view/feed/http://feeds.feedburner.com/komodomedia" }];
var fm9 = new FeedMenu(oCustomLinks);
fm9.write('#jquery_feed_menu_example_9');
//]]&gt;
</script></p>
<h4>And, here&#8217;s the custom code:</h4>
<p><code>var oCustomLinks = [<br />
   {<br />
      title:'RSS Feed',<br />
      href:"http://feeds.feedburner.com/komodomedia"<br />
   },<br />
   {<br />
      title:'Subscribe with Bloglines',<br />
      href:"http://www.bloglines.com/sub/http://feeds.feedburner.com/komodomedia"<br />
   },<br />
   {<br />
      title:'Subscribe with Google Reader',<br />
      href:"http://www.google.com/reader/view/feed/http://feeds.feedburner.com/komodomedia"<br />
   }<br />
];<br />
var fm = new FeedMenu(oCustomLinks);<br />
fm.write('#jquery_feed_menu_example_6');</code></p>
<p>You can <a class="download" href="http://www.komodomedia.comwp-content/uploads/2008/10/jquery_feed_menu.zip">download</a> all of the files used here to use on your site. Feel free to modify and use this code how you see fit and if you use it, please drop a comment here to show me how you&#8217;ve used it.</p>
<p><small>This <span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/StillImage" rel="dc:type">work</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License</a>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2008/10/jquery-feed-menus/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
		<item>
		<title>Using jQuery to save form details</title>
		<link>http://www.komodomedia.com/blog/2008/07/using-jquery-to-save-form-details/</link>
		<comments>http://www.komodomedia.com/blog/2008/07/using-jquery-to-save-form-details/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 23:08:34 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Nerdlab]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.komodomedia.com/?p=259</guid>
		<description><![CDATA[Ok, so I have a few loves in my life.  In web technologies, my love rests in design, jQuery programming and JavaScript, CSS and XHTML.  I love playing around with interfaces and front-end UI design and website design.  Today, I&#8217;m gonna bust out a short post on how I used a snippet [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so I have a few loves in my life.  In web technologies, my love rests in design, jQuery programming and JavaScript, CSS and XHTML.  I love playing around with interfaces and front-end UI design and website design.  Today, I&#8217;m gonna bust out a short post on how I used a snippet of jQuery code to remember my user data, i.e. Name, website, email address, etc. to help out your users a wee bit.</p>
<h3>First, an example</h3>
<p>Let&#8217;s create a text input that we want to be remembered.  I&#8217;ll give the the every-so-appropriate name of <em>fav_starbucks_drink</em> Here it is:</p>
<p><label for="fav_starbucks_drink"><strong>Fav Starbucks drink o&#8217; choice:</strong> </label></p>
<input id="fav_starbucks_drink" name="fav_starbucks_drink" type="text" style="width:200px"/>
<script type="text/javascript">
<!--
$(document).ready( function(){remember("[name=fav_starbucks_drink]");} );
//--></script></p>
<p>For all you n00bs out there, the XHTML code is:</p>
<p><code>&lt;input name="fav_starbucks_drink" type="text" /&gt;</code></p>
<p>Test this jQuery code out by entering in a value in the input and then <a href="http://www.komodomedia.com/blog/2008/07/using-jquery-to-save-form-details/">refreshing the page</a>.</p>
<h3>jQuery Code:</h3>
<p>Realize two things. You&#8217;ll need the <a href="http://plugins.jquery.com/project/cookie">jQuery cookie plugin</a> as well as a <a href="http://docs.jquery.com/Downloading_jQuery">link to jQuery itself.</a> We are going to be using the cookie plugin to cookie or save the user&#8217;s data.</p>
<p><code>function remember( selector ){<br />
    $(selector).each(<br />
    	function(){<br />
    		//if this item has been cookied, restore it<br />
    		var name = $(this).attr('name');<br />
    		if( $.cookie( name ) ){<br />
    			$(this).val( $.cookie(name) );<br />
    		}<br />
    		//assign a change function to the item to cookie it<br />
    		$(this).change(<br />
    			function(){<br />
    				$.cookie(name, $(this).val(), { path: '/', expires: 365 });<br />
    			}<br />
    		);<br />
    	}<br />
    );<br />
}</code></p>
<h3>Restoring saved field values</h3>
<p>Aight. Let&#8217;s just dive into explaining this hunk of code.  First, you will notice the function declaration:<br />
<code>function remember( selector ){</code></p>
<p>The function parameter <em>selector</em> is a jQuery selector, which happens to be either a CSS3 selector that targets the desired inputs or a collection of jQuery objects.</p>
<p>Next:</p>
<p><code> $(selector).each( function{...</code></p>
<p><em>$.each</em> is a sweet function that executes the function passed in as it&#8217;s argument for every object within the jQuery collection as created by the <em>selector</em> parameter. If you are lost at this point, let it suffice to say that we are going to loop through all of the input items as identified by their selectors.</p>
<p>Now, lets digest a bigger chunk.  This next segment of code will perform the function of restoring any saved values.  Now, hopefully this script is being ran on page load, so this restore segment will restore the field values on page load.  Here&#8217;s that jazzy code now:</p>
<p><code>var name = $(this).attr('name');<br />
if( $.cookie( name ) ){<br />
    	$(this).val( $.cookie(name) );<br />
}</code></p>
<p>First, a variable <em>name</em> is created and set to the attribute of name on the input item.  What does that mean you ask?  Well, basically we don&#8217;t know the selector that targeted this input, but we want to store the name of the form item as we aren&#8217;t  guaranteed we will have an id. Cool now the name attribute of the input is stored in the var of name, so fittingly named.</p>
<p>Next, the code is <code class="inline">if( $.cookie( name ) )</code>. What&#8217;s that mean?  Think of it like this: &#8220;Is there a cookie with this name&#8221;? Okay, so if we have cookied the value for this input, it&#8217;ll be in that cookie. Radness. Okay, if there is a cookie, set this input item&#8217;s value attribute to that value.  Simple eh?  By using the <em>$.val()</em> function, I can set the value if I pass a parameter or I can get a value by leaving params emtpy. Eazy peezy &#8211; set the value to the cookie with that name:</p>
<p><code>$(this).val( $.cookie(name) );</code></p>
<p>Ok, now we have code for all input items of type text and textareas to be set.  We won&#8217;t cover checkboxes, radio&#8217;s and select lists on this post.</p>
<h3>Creating functions to save field values on change</h3>
<p>This block of code is uber simple. Check it:</p>
<p><code>$(this).change(<br />
    	function(){<br />
    	    	$.cookie(name, $(this).val(), { path: '/', expires: 365 });<br />
    	}<br />
);</code></p>
<p>Guess what <code class="inline">$(this).change()</code> does?  That&#8217;s right, it creates an onchange function handler for the targeted input item. So whatever function we pass the change function will be ran when input item&#8217;s value is changed. Word.</p>
<p>Wow, this one is easy.  Guess what, when this input item gets changed, cookie it.  That&#8217;s it.  In plain english, we are naming the cookie the name of the input item, we are assigning it the value of the input, it&#8217;s path is the root of the site and it expires 1 year from now. Rocking.</p>
<p>Last, lets run the code.  Do that by calling the function, passing it the selector to target the item.  Something like this will suffice:</p>
<p><code>remember( '[name=fav_starbucks_drink]' );</code></p>
<p>Ooh, check that out, <a href="http://www.w3.org/TR/REC-CSS2/selector.html#attribute-selectors">I used an attribute selector</a>, which since jQuery supports up to CSS3 selectors, will actually work on IE6. ;) </p>
<p>You could also run the code as soon as the document is ready by doing something like this:</p>
<p><code>$(document).ready(<br />
    function(){<br />
    	remember( '[name=fav_starbucks_drink]' );<br />
    }<br />
);</code></p>
<p>That&#8217;s it.  This code could obviously be improved no doubt, including handlers for select, checkboxes, radios and more, but you get the gist.  This script was uber easy to bust out.  I heart jQuery. Do you?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2008/07/using-jquery-to-save-form-details/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Komodo Media Version 4</title>
		<link>http://www.komodomedia.com/blog/2008/05/komodo-media-version-4/</link>
		<comments>http://www.komodomedia.com/blog/2008/05/komodo-media-version-4/#comments</comments>
		<pubDate>Fri, 09 May 2008 03:44:48 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Icons]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Logo]]></category>
		<category><![CDATA[xHTML]]></category>

		<guid isPermaLink="false">http://www.komodomedia.com/?p=231</guid>
		<description><![CDATA[<img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2008/05/kmv4_peek.jpg" alt="" title="kmv4_peek" width="450" height="165" class="alignnone size-full wp-image-233" />
A project of part toil, part slavery, part love and part pure maniac, Komodo Media's version 4 installment, code name <em>"Expedition"</em> aka <em>"code commando"</em> is alive and breathing.  
]]></description>
			<content:encoded><![CDATA[<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2008/05/kmv4_peek.jpg" alt="" title="kmv4_peek" width="450" height="165" class="alignnone size-full wp-image-233" /><br />
A project of part toil, part slavery, part love and part pure maniac, Komodo Media&#8217;s version 4 installment, code name <em>&#8220;Expedition&#8221;</em> aka <em>&#8220;code commando&#8221;</em> is alive and breathing.  </p>
<p>I&#8217;ll post more on what I learned in the designing process as well as releasing some freebies, so stay tuned.  As for now, I&#8217;m a tired boy and I&#8217;m gonna take a rest. Please leave a comment and let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2008/05/komodo-media-version-4/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: komodomedia.com @ 2012-02-03 20:43:31 by W3 Total Cache -->
