<?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>Stephen Gray&#039;s dev blog &#187; plugin</title>
	<atom:link href="http://blog.s-gray.com/tag/plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.s-gray.com</link>
	<description>e-commerce and integrations</description>
	<lastBuildDate>Sun, 17 Jan 2010 09:32:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>jQuery create a simple plugin</title>
		<link>http://blog.s-gray.com/2008/08/11/jquery-create-a-simple-plugin/</link>
		<comments>http://blog.s-gray.com/2008/08/11/jquery-create-a-simple-plugin/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 11:33:32 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://colourgray.wordpress.com/?p=72</guid>
		<description><![CDATA[This is just a quick tutorial (more of a code snippet) for creating a very simple plugin for jQuery.
Of course, there are lots of tutorials around for this, this is mainly for reference  
$.fn.myFunction = function()
{
    // use the following loop to iterate through all objects 
    // returned by the jQuery selector which was used
    return [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a quick tutorial (more of a code snippet) for creating a very simple plugin for jQuery.</p>
<p>Of course, there are lots of tutorials around for this, this is mainly for reference <img src='http://blog.s-gray.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><code>$.fn.myFunction = function()</code><br />
<code>{</code><br />
<code>    // use the following loop to iterate through all objects </code><br />
<code>    // returned by the jQuery selector which was used</code><br />
<code>    return this.each(function()</code><br />
<code>    {</code><br />
<code>        // here we can access any properties using</code><br />
<code>        // the normal jQuery selectors</code><br />
<code>        alert($(this).html());</code><br />
<code>        $(this).addClass('red');</code><br />
<code>    });</code><br />
<code>};</code></p>
<p>So this function alerts the HTML of the selected element(s) and adds a new class &#8216;red&#8217;. You can then call the new function using:</p>
<p><code>$('#myElement').myFunction();</code></p>
<p>Another example of how easy and powerful jQuery is <img src='http://blog.s-gray.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <a href="http://docs.jquery.com/Plugins/Authoring" target="_blank">Look here for more information</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.s-gray.com/2008/08/11/jquery-create-a-simple-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

