<?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>KirkHings.com &#187; jQuery</title>
	<atom:link href="http://kirkhings.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://kirkhings.com</link>
	<description>The '-berger' part trips up so many folks that I sometimes simplify my name for you. Yes, just for you.</description>
	<lastBuildDate>Sat, 13 Jun 2009 18:35:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>jQuery fadeOut upon click</title>
		<link>http://kirkhings.com/code/jquery/jquery-fadeout-upon-click/307/</link>
		<comments>http://kirkhings.com/code/jquery/jquery-fadeout-upon-click/307/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 19:50:52 +0000</pubDate>
		<dc:creator>Kirk</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[self-instructional challenge]]></category>

		<guid isPermaLink="false">http://kirkhings.com/?p=307</guid>
		<description><![CDATA[ photo credit: Joel Bedford
This programming snippet is from the themeforest.net video series &#8220;jQuery for beginners&#8221; which I watched and practiced spring 2009. I do not mean to steal from them, but just post how I performed their tutorials for my own later reference and perhaps save someone else the time of watching the videos.
I [...]


Related posts:<ul><li><a href='http://kirkhings.com/code/jquery/disable-submit-button-to-prevent-double-submit/170/' rel='bookmark' title='Permanent Link: Disable Submit Button to Prevent Double-Submit'>Disable Submit Button to Prevent Double-Submit</a> <small> photo credit: kevindooley This programming snippet is from the...</small></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="borrowedPic"><a href="http://www.flickr.com/photos/71078118@N00/2279307796/" title="self with colored tiles" target="_blank"><img src="http://farm3.static.flickr.com/2143/2279307796_c2b24cc4b3.jpg" alt="self with colored tiles" border="0" /></a><br /><small><a href="http://creativecommons.org/licenses/by-nd/2.0/" title="Attribution-NoDerivs License" target="_blank"><img src="http://kirkhings.com/wp-content/plugins/photo-dropper/images/cc.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/71078118@N00/2279307796/" title="Joel Bedford" target="_blank">Joel Bedford</a></small></div>
<p>This programming snippet is from the themeforest.net video series &#8220;jQuery for beginners&#8221; which I watched and practiced spring 2009. I do not mean to steal from them, but just post how I performed their tutorials for my own later reference and perhaps save someone else the time of watching the videos.</p>
<p>I post these old code snippets for a few reasons. One is to demonstrate my programming learning, experience, and progression. Another reason is to make sure my code and solutions are indexed by search engines, so that other beginning programmers may get help if they need it. Finally, it is just nice for me to have my own code snippet library, to easily find snippets that I remember doing a particular job but I cannot always recall where I found it.</p>
<blockquote><p>Challenge: Download jQuery script from jQuery.com (get the production version, not the development version). Link to the jQuery script file form your index.html. Write simple animation script to fade out a div element when a link is clicked.
</p></blockquote>
<p>Solution: </p>
<pre class="brush: xml;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
	&lt;title&gt;Beginner's jQuery&lt;/title&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;script.js&quot;&gt;&lt;/script&gt;
	&lt;style type=&quot;text/css&quot;&gt;
		#box {
			background: blue;
			width: 200px;
			height: 100px;
		}
	&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;div id=&quot;box&quot;&gt;&lt;/div&gt;
	&lt;a href=&quot;#&quot;&gt;Click me&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Here is the script to animate the box fading away: </p>
<pre class="brush: jscript;">
// start a generic function
$(function() {
	// when link is clicked, start a sub-function
	$('a').click(function() {
		// make the element with id='box' fade out over 5 seconds
		$('#box').fadeOut(5000);
	});
});
</pre>
<p>Note that you can also use fadeOut(&#8217;slow&#8217;); or &#8216;fast&#8217; without specifying actual milliseconds.</p>


<p>Related posts:<ul><li><a href='http://kirkhings.com/code/jquery/disable-submit-button-to-prevent-double-submit/170/' rel='bookmark' title='Permanent Link: Disable Submit Button to Prevent Double-Submit'>Disable Submit Button to Prevent Double-Submit</a> <small> photo credit: kevindooley This programming snippet is from the...</small></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://kirkhings.com/code/jquery/jquery-fadeout-upon-click/307/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable Submit Button to Prevent Double-Submit</title>
		<link>http://kirkhings.com/code/jquery/disable-submit-button-to-prevent-double-submit/170/</link>
		<comments>http://kirkhings.com/code/jquery/disable-submit-button-to-prevent-double-submit/170/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 18:47:45 +0000</pubDate>
		<dc:creator>Kirk</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[front-line defense]]></category>
		<category><![CDATA[self-instructional challenge]]></category>
		<category><![CDATA[submit]]></category>

		<guid isPermaLink="false">http://kirkhings.com/?p=170</guid>
		<description><![CDATA[ photo credit: kevindooley
This programming snippet is from the book, &#8220;jQuery in Action&#8221; which I read and practiced Spring 2009. The Chapter (3) was titled &#8220;Bringing pages to life with jQuery&#8221;.
I post these old code snippets for a few reasons. One is to demonstrate my programming learning, experience, and progression. Another reason is to make [...]


Related posts:<ul><li><a href='http://kirkhings.com/code/jquery/jquery-fadeout-upon-click/307/' rel='bookmark' title='Permanent Link: jQuery fadeOut upon click'>jQuery fadeOut upon click</a> <small> photo credit: Joel Bedford This programming snippet is from...</small></li>
<li><a href='http://kirkhings.com/code/visual-basic-code/button-driven-quotes/352/' rel='bookmark' title='Permanent Link: Button-Driven Quotes'>Button-Driven Quotes</a> <small> photo credit: bogenfreund This programming challenge is from a...</small></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="borrowedPic"><a href="http://www.flickr.com/photos/12836528@N00/2172001078/" title="Meow Wars" target="_blank"><img src="http://farm3.static.flickr.com/2041/2172001078_d66b957d45.jpg" alt="Meow Wars" border="0" /></a><br /><small><a href="http://creativecommons.org/licenses/by/2.0/" title="Attribution License" target="_blank"><img src="http://kirkhings.com/wp-content/plugins/photo-dropper/images/cc.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/12836528@N00/2172001078/" title="kevindooley" target="_blank">kevindooley</a></small></div>
<p>This programming snippet is from the book, &#8220;jQuery in Action&#8221; which I read and practiced Spring 2009. The Chapter (3) was titled &#8220;Bringing pages to life with jQuery&#8221;.</p>
<p>I post these old code snippets for a few reasons. One is to demonstrate my programming learning, experience, and progression. Another reason is to make sure my code and solutions are indexed by search engines, so that other beginning programmers may get help if they need it. Finally, it is just nice for me to have my own code snippet library, to easily find snippets that I remember doing a particular job but I cannot always recall where I found it.</p>
<blockquote><p>Problem: people sometimes double-click (or more) submit buttons on html forms. Either they do it accidentally because their finger slipped or they did not think they clicked it the first time, or they just like the clicking sound. This can cause a problem with the form being submitted multiple times to the server.
</p></blockquote>
<p>Solution: This jQuery script disables the submit button after the first click. Of course you still need server side code to prevent multiple submissions in case JavaScript is disabled, but this is a good little script for the front line defense. </p>
<pre class="brush: jscript;">
$(&quot;form&quot;).submit(function() {
$(&quot;:submit&quot;,this).attr(&quot;disabled&quot;, &quot;disabled&quot;);
});
</pre>


<p>Related posts:<ul><li><a href='http://kirkhings.com/code/jquery/jquery-fadeout-upon-click/307/' rel='bookmark' title='Permanent Link: jQuery fadeOut upon click'>jQuery fadeOut upon click</a> <small> photo credit: Joel Bedford This programming snippet is from...</small></li>
<li><a href='http://kirkhings.com/code/visual-basic-code/button-driven-quotes/352/' rel='bookmark' title='Permanent Link: Button-Driven Quotes'>Button-Driven Quotes</a> <small> photo credit: bogenfreund This programming challenge is from a...</small></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://kirkhings.com/code/jquery/disable-submit-button-to-prevent-double-submit/170/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
