<?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>360innovate Blog &#187; jQuery</title>
	<atom:link href="http://www.360innovate.co.uk/blog/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.360innovate.co.uk/blog</link>
	<description></description>
	<lastBuildDate>Mon, 16 Jan 2012 15:21:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Our 10k app, Video Poker!</title>
		<link>http://www.360innovate.co.uk/blog/2010/08/our-10k-app-video-poker/</link>
		<comments>http://www.360innovate.co.uk/blog/2010/08/our-10k-app-video-poker/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 08:52:59 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[General Chat]]></category>
		<category><![CDATA[Web Development Articles]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.360innovate.co.uk/blog/?p=2185</guid>
		<description><![CDATA[As you might be aware, An Event Apart have been running a competition to find the best web app written in 10k or less. For the web-developmentally-challenged among you, (you lucky, lucky souls&#8230;), this isn&#8217;t a great deal of space to work with, so optimization is the name of the game! You can see the gallery [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2010%2F08%2Four-10k-app-video-poker%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2010%2F08%2Four-10k-app-video-poker%2F&amp;source=360innovate&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>As you might be aware, <a href="http://aneventapart.com/">An Event Apart</a> have been running a competition to find the best web app written in 10k or less. For the web-developmentally-challenged among you, (you lucky, lucky souls&#8230;), this isn&#8217;t a great deal of space to work with, so optimization is the name of the game!</p>
<p>You can see the <a href="http://10k.aneventapart.com/">gallery of apps here</a>. There are some truly amazing examples of what can be achieved with a little creativity, and the standard of app on display is extremely high. (Although with some rock-star calibre developers entering the competition, this was almost to be expected!)</p>
<p>For our own entry, I <a href="http://10k.aneventapart.com/Entry/227">recreated the game of Video Poker</a> (with graphics from <a href="http://twitter.com/todd_unctious">Allan</a>).</p>
<p><img class="alignnone size-full wp-image-2186" title="poker" src="http://www.360innovate.co.uk/blog/wp-content/uploads/2010/08/poker.png" alt="" width="300" height="200" /></p>
<p>If you want to take a look at the uncompressed source code, it&#8217;s available on <a href="http://github.com/johnmcc/Video-Poker">github</a>, under the MIT License.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.360innovate.co.uk/blog/2010/08/our-10k-app-video-poker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery plugin to show and hide vertical menus</title>
		<link>http://www.360innovate.co.uk/blog/2010/07/jquery-plugin-to-show-and-hide-vertical-menus/</link>
		<comments>http://www.360innovate.co.uk/blog/2010/07/jquery-plugin-to-show-and-hide-vertical-menus/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 13:29:57 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Tips & Tutorials]]></category>
		<category><![CDATA[Web Development Articles]]></category>
		<category><![CDATA[hide]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[show]]></category>

		<guid isPermaLink="false">http://www.360innovate.co.uk/blog/?p=2091</guid>
		<description><![CDATA[It&#8217;s very common for us to show and hide vertical menus when developing sites. This idiom is particularly common on sites with a lot of submenus, such as e-commerce shopping carts. Since it&#8217;s a technique we use so frequently, we decided to write a little jQuery plugin to make life easier for ourselves. This plugin [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2010%2F07%2Fjquery-plugin-to-show-and-hide-vertical-menus%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2010%2F07%2Fjquery-plugin-to-show-and-hide-vertical-menus%2F&amp;source=360innovate&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>It&#8217;s very common for us to show and hide vertical menus when developing sites. This idiom is particularly common on sites with a lot of submenus, such as <a href="http://www.360innovate.co.uk/service/ecommerce/">e-commerce shopping carts</a>.</p>
<p><img class="aligncenter size-medium wp-image-2092" title="Screenshot" src="http://www.360innovate.co.uk/blog/wp-content/uploads/2010/07/Screenshot-300x238.png" alt="" width="300" height="238" /></p>
<p>Since it&#8217;s a technique we use so frequently, we decided to write a little jQuery plugin to make life easier for ourselves. This plugin takes nested unordered lists and turns them into expandable and contractable menus.</p>
<p>The plugin has the following features:</p>
<ul>
<li>Dual licenced under GPL / MIT licences – do what you want with this code (as long as you leave the licence intact!)</li>
<li>Lightweight (~2Kb packed)</li>
<li>Keyboard accessible, basic WAI-ARIA support. Usable with JavaScript switched off.</li>
<li>Easy to use and deploy</li>
<li>Configurable through CSS, callback functions and numerous options</li>
</ul>
<p>Please note that this plugin optionally uses of <a href="http://stilbuero.de/">Klaus Hartl</a>&#8216;s excellent jquery.cookie.js plugin.</p>
<p>You can <a href="http://www.360innovate.co.uk/blog/cmenu.zip">download the plugin here</a>, and <a href="http://www.360innovate.co.uk/blog/cmenu.html">view the docs, and an example here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.360innovate.co.uk/blog/2010/07/jquery-plugin-to-show-and-hide-vertical-menus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery 1.4 Reference Guide review</title>
		<link>http://www.360innovate.co.uk/blog/2010/03/jquery-1-4-reference-guide-review/</link>
		<comments>http://www.360innovate.co.uk/blog/2010/03/jquery-1-4-reference-guide-review/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 10:36:52 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[General Chat]]></category>
		<category><![CDATA[Web Development Articles]]></category>
		<category><![CDATA[book review]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.360innovate.co.uk/blog/?p=1755</guid>
		<description><![CDATA[In the interests of full disclosure, Packt Publishing sent me a copy of this book for me to review. There was no other compensation received for this review. I am reviewing this book for the benefit of the blog readers. The recent release of jQuery 1.4 brought a plethora of new features and major performance [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2010%2F03%2Fjquery-1-4-reference-guide-review%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2010%2F03%2Fjquery-1-4-reference-guide-review%2F&amp;source=360innovate&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><em>In the interests of full disclosure, Packt Publishing sent me a copy of this book for me to review. There was no other compensation received for this review. I am reviewing this book for the benefit of the blog readers.</em></p>
<p>The recent release of jQuery 1.4 brought a plethora of new features and major performance improvements across the board. At the same time, the new <a href="http://api.jquery.com/">jQuery API</a> site was launched in an effort to improve the documentation and  community spirit. Make no mistake, 1.4 is a milestone release for jQuery.</p>
<p>To mark this, <a href="http://www.karlswedberg.com/">Karl Swedberg</a> and <a href="http://www.packtpub.com/author_view_profile/id/134">Jonathan Chaffer</a> have released the <a href="http://www.packtpub.com/jquery-1-4-reference-guide/book">jQuery 1.4 Reference Guide</a>, an exhaustive tour of the functionality that jQuery 1.4 offers. There are eleven chapters, covering selectors, DOM traversal and manipulation, events, effects, AJAX, plug-ins, and more. In addition, there&#8217;s an alphabetical API reference guide and a couple of really useful appendixes providing lots of handy information.</p>
<p>As I mentioned above, each chapter groups together jQuery methods with a common theme. There are helpful code samples for each method, and they are explained thoroughly in the accompanying text. Occasionally, performance tips are mentioned, but as the book stresses early on, you shouldn&#8217;t worry too much about micro-optimizing code &#8211; your time as a developer is more valuable than that!</p>
<p>So who is this book aimed at? Well, as the name suggests, this is a reference guide. A familiarity with jQuery syntax is essential, and in some areas, a decent knowledge of vanilla JavaScript will be beneficial too. Although there are hints and tips peppered throughout the book, this is no tutorial book. If you&#8217;re not familiar with jQuery, you should pick up <a href="http://www.packtpub.com/learning-jquery-1.3/book">Learning jQuery</a> instead, by the same authors.</p>
<p>As such, I would recommend this to the intermediate to advanced jQuery user. You will almost certainly learn something from the book, and a reference guide always comes in handy! Some of the major points I picked up were:</p>
<ul>
<li>Many jQuery methods accept anonymous functions as parameters now &#8211; this is a really clean, practical way of writing code</li>
<li>There are more ways to measure elements than I realised &#8211; I knew about .height() and .width(), but not .innerHeight(), .outerHeight() etc. This has caused me problems in the past!</li>
<li>The Sizzle selector engine is really, really powerful and I&#8217;m not using it to its full potential.</li>
</ul>
<p>The downside of a book like this is that it dates relatively quickly. For example, jQuery 1.4.2 introduced two methods &#8211; .delegate() and .undelegate() &#8211; which are not covered in the book. There&#8217;s no getting around this when the library itself is under heavy development, but it&#8217;s something that you should be aware of if you&#8217;re considering purchasing.</p>
<p>I also spotted one error  that I reported at the publisher&#8217;s website, so if you do purchase this book, you should keep an eye on the errata there.</p>
<p>However, if you&#8217;re looking for a jQuery reference guide, this is the book to own. The publishers will donate to the jQuery project for every copy of the book sold and you <strong>will</strong> learn something from this book, so it&#8217;s a win-win situation! The <a href="http://www.packtpub.com/jquery-reference-guide-Open-Source">jQuery Reference Guide</a> is on sale now, with a cover price of £24.99.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.360innovate.co.uk/blog/2010/03/jquery-1-4-reference-guide-review/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery UI 1.7 &#8211; The User Interface library for jQuery &#8211; reviewed</title>
		<link>http://www.360innovate.co.uk/blog/2010/02/jquery-ui-1-7-the-user-interface-library-for-jquery-reviewed/</link>
		<comments>http://www.360innovate.co.uk/blog/2010/02/jquery-ui-1-7-the-user-interface-library-for-jquery-reviewed/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 08:53:52 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Design and Usability]]></category>
		<category><![CDATA[Web Development Articles]]></category>
		<category><![CDATA[book review]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery UI]]></category>

		<guid isPermaLink="false">http://www.360innovate.co.uk/blog/?p=1729</guid>
		<description><![CDATA[jQuery UI is the official interface library for jQuery, the leading JavaScript framework. Dan Wellman&#8216;s book, jQuery UI 1.7 &#8211; The User Interface library for jQuery, is intended to be the &#8216;missing manual&#8217; &#8211; fleshing out the online documentation with examples, tutorials, and an in-depth look at the API. The book is supported by many [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2010%2F02%2Fjquery-ui-1-7-the-user-interface-library-for-jquery-reviewed%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2010%2F02%2Fjquery-ui-1-7-the-user-interface-library-for-jquery-reviewed%2F&amp;source=360innovate&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://jqueryui.com/"></a></p>
<div id="attachment_1730" class="wp-caption alignright" style="width: 110px"><a href="http://www.360innovate.co.uk/blog/wp-content/uploads/2010/02/ui17.png"><img class="size-full wp-image-1730" title="ui1.7" src="http://www.360innovate.co.uk/blog/wp-content/uploads/2010/02/ui17.png" alt="jQuery UI 1.7 by Dan Wellman" width="100" height="123" /></a><p class="wp-caption-text">jQuery UI 1.7 by Dan Wellman</p></div>
<p>jQuery UI is the official interface library for jQuery, the leading JavaScript framework. <a href="http://www.danwellman.co.uk/">Dan Wellman</a>&#8216;s book, jQuery UI 1.7 &#8211; The User Interface library for jQuery, is intended to be the &#8216;missing manual&#8217; &#8211; fleshing out the online documentation with examples, tutorials, and an in-depth look at the API. The book is supported by many great code samples, which are available at <a href="http://www.packtpub.com/support">Packt&#8217;s support site</a>.</p>
<p>There are thirteen chapters in total, covering the  high-level widgets (such as the accordion) and low-level widgets (such as the draggable and droppable interaction helpers.) In addition, the CSS and effects frameworks are covered too.</p>
<p>No knowledge of jQuery UI is assumed, although it is expected that the reader will have a decent grasp of HTML, CSS, and jQuery. The book is pitched at the beginner to intermediate level jQuery UI user, although I would think that even advanced users will find that it contains valuable information.</p>
<p>The structure of each chapter is similar. Starting with the most basic example to get you up and running, more options are gradually introduced to give you a greater level of control, with plenty of code samples to help you along. Most chapters finish with a more advanced scenario, showing some really imaginative uses in which jQuery UI shines. For example, the drag and drop chapter walks the reader through creating a simple game.</p>
<p>The book also takes the time to describe some of the rare occasions where cross-browser issues might rear their heads, along with the fixes. It would have been easy for the author to skip past those parts, but I appreciated this honest approach. It may not be the sexiest subject matter, but it&#8217;s something that we as web developers deal with on a day-to-day basis, so it was great to see it tackled in the book.</p>
<p>One of the major strengths of jQuery UI is its online documentation; there are  several examples for each widget, and options and methods are well documented. I was initially a little concerned about what the book could add to this, but my concerns were unfounded. Every chapter revealed  methods and options that I had missed, along with examples that used the library in ways I would never have thought of.</p>
<p>One of the biggest revelations to me was the chapter relating to the CSS framework. Although I&#8217;d used <a href="http://jqueryui.com/themeroller/">Themeroller</a> before, I&#8217;d never appreciated the full extent to which it can be used, creating a consistent look and feel throughout your site and containing many valuable helper classes.</p>
<p>One area where I would have liked to see some information is that of extending jQuery UI. I would have liked to have read about writing your own widgets, inheriting from $.widget, but I appreciate that this would probably be out of scope for this type of book.</p>
<p>Although jQuery UI 1.8 is just round the corner, I would have no hesitation in recommending this book. There is a wealth of information here, and it is presented in such a way that the reader is given a real understanding of the library, meaning that you won&#8217;t have any problems when the next version rolls along. In fact, if you read this book now, you&#8217;ll be well prepared for all the goodies that 1.8 contains!</p>
<p>So if you&#8217;re looking for a <a href="http://www.packtpub.com/user-interface-library-for-jquery-ui-1-7">jQuery UI book</a>, you should definitely check this one out!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.360innovate.co.uk/blog/2010/02/jquery-ui-1-7-the-user-interface-library-for-jquery-reviewed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessible AJAX forms with jQuery</title>
		<link>http://www.360innovate.co.uk/blog/2009/06/accessible-ajax-forms-with-jquery/</link>
		<comments>http://www.360innovate.co.uk/blog/2009/06/accessible-ajax-forms-with-jquery/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 20:20:52 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Web Development Articles]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.360innovate.co.uk/blog/?p=822</guid>
		<description><![CDATA[Unless you&#8217;ve buried your head in the sand for the last few years, you must have noticed the increased use of Javascript on the web. One of the most common criticisms levelled against the increased use of Javascript is that it makes accessible web design difficult, or even impossible. This doesn&#8217;t have to be the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2009%2F06%2Faccessible-ajax-forms-with-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2009%2F06%2Faccessible-ajax-forms-with-jquery%2F&amp;source=360innovate&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Unless you&#8217;ve buried your head in the sand for the last few years, you must have noticed the increased use of Javascript on the web.</p>
<p>One of the most common criticisms levelled against the increased use of Javascript is that it makes <a href="http://www.360innovate.co.uk">accessible web design</a> difficult, or even impossible. This doesn&#8217;t have to be the case though &#8211; let&#8217;s take a look at how progressive enhancement techniques can improve usability without sacrificing accessibility.</p>
<p>The concept is straightforward &#8211; make sure that everything works without Javascript, then use Javascript to add the &#8216;icing on the cake&#8217;.</p>
<p>Basically, all the content and functionality on your site should be accessible to your users, regardless of whether Javascript is switched on or off. This not only has benefits for accessibility, but for <a title="SEO Company Glasgow" href="http://www.360innovate.co.uk/service/search-engine-optimisation/">SEO</a> too.</p>
<p>In this example, I&#8217;m going to take a very plain, simple form and add a little bit of magic!</p>
<h2 style="margin-bottom: 10px;">The HTML</h2>
<pre id="line37">&lt;<span class="start-tag">div</span><span class="attribute-name"> id</span>=<span class="attribute-value">"form"</span>&gt;
    &lt;<span class="start-tag">form</span><span class="attribute-name"> action</span>=<span class="attribute-value">"" </span><span class="attribute-name">method</span>=<span class="attribute-value">"post" </span><span class="attribute-name">name</span>=<span class="attribute-value">"contact-form"</span>&gt;
        &lt;<span class="start-tag">label</span><span class="attribute-name"> for</span>=<span class="attribute-value">"name"</span>&gt;Your name:&lt;/<span class="end-tag">label</span>&gt;
        &lt;<span class="start-tag">input</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text" </span><span class="attribute-name">name</span>=<span class="attribute-value">"name" </span><span class="attribute-name">id</span>=<span class="attribute-value">"name" </span><span class="error"><span class="attribute-name">/</span></span>&gt;

        &lt;<span class="start-tag">label</span><span class="attribute-name"> for</span>=<span class="attribute-value">"email"</span>&gt;Your email address:&lt;/<span class="end-tag">label</span>&gt;
        &lt;<span class="start-tag">input</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text" </span><span class="attribute-name">name</span>=<span class="attribute-value">"email" </span><span class="attribute-name">id</span>=<span class="attribute-value">"email" </span><span class="error"><span class="attribute-name">/</span></span>&gt;</pre>
<pre id="line48">        &lt;<span class="start-tag">input</span><span class="attribute-name"> type</span>=<span class="attribute-value">"submit" </span><span class="attribute-name">name</span>=<span class="attribute-value">"submit" </span><span class="attribute-name">value</span>=<span class="attribute-value">"submit" </span><span class="error"><span class="attribute-name">/</span></span>&gt;
    &lt;/<span class="end-tag">form</span>&gt;
&lt;/<span class="end-tag">div</span>&gt;

&lt;<span class="start-tag">div</span><span class="attribute-name"> id</span>=<span class="attribute-value">"results"</span>&gt;&lt;/<span class="end-tag">div</span>&gt;</pre>
<h2 style="margin: 10px 0;">The jQuery</h2>
<pre id="line1">$(document).ready(function(){
    $('form[name="contact-form"]').submit(function(event){
        event.preventDefault();

        var myName    = $('input#name').val();
        var myEmail   = $('input#email').val(); 

        $.post('process.php', {name: myName, email: myEmail},
            function(data){
                $('div#results').html(data).fadeOut().fadeIn();
            }
        )
    })
})</pre>
<p>Hopefully there&#8217;s nothing too scary in the HTML; a couple of input fields and an empty div that will hold our results.</p>
<p>In the javascript, the important parts are lines two and three. Notice that we&#8217;re intercepting the form submission, and passing the event as an argument to the following function.</p>
<p>Next, we call event.preventDefault(). This stops events from bubbling up the DOM, in this case, preventing the form from being submitted.</p>
<p>Next, we fire off an AJAX request to process the form. In this case, we&#8217;re just echoing out the values that have been entered by the user, but this could be a contact form, a login form, an &#8216;add to cart&#8217; button &#8211; the possibilities are endless!</p>
<p><a href="http://www.360innovate.co.uk/blog/demos/ajaxforms/index.php">You can view the demo here.</a></p>
<p>Note that the form works with or without javascript. Test it yourself by turning javascript off!</p>
<p>I hope this explains the basics of progressive enhancement. For further reading, check out <a href="http://en.wikipedia.org/wiki/Progressive_enhancement">wikipedia&#8217;s entry on the subject</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.360innovate.co.uk/blog/2009/06/accessible-ajax-forms-with-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PeriodicalUpdater for jQuery</title>
		<link>http://www.360innovate.co.uk/blog/2009/03/periodicalupdater-for-jquery/</link>
		<comments>http://www.360innovate.co.uk/blog/2009/03/periodicalupdater-for-jquery/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 21:52:01 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Web Development Articles]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.360innovate.co.uk/blog/?p=373</guid>
		<description><![CDATA[Here at 360innovate we&#8217;ve benefitted greatly from free and open source software. Whether it&#8217;s the web server our sites run on or the operating system that runs the web server, free and open source software plays a huge part in the industry we work in. And so, we present this jQuery plugin in an effort [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2009%2F03%2Fperiodicalupdater-for-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2009%2F03%2Fperiodicalupdater-for-jquery%2F&amp;source=360innovate&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Here at 360innovate we&#8217;ve benefitted greatly from free and open source software.</p>
<p>Whether it&#8217;s the web server our sites run on or the operating system that runs the web server, free and open source software plays a huge part in the industry we work in.</p>
<p>And so, we present this <a href="http://jquery.com">jQuery</a> plugin in an effort to give a little something back!</p>
<p>The <a href="http://www.prototypejs.org/">Prototype</a> javascript library features a very useful <a href="http://www.prototypejs.org/api/ajax/periodicalUpdater">PeriodicalUpdater()</a> function. This loads content at specified intervals, but if the content being pulled in doesn&#8217;t change, the interval gradually increases.</p>
<p>There are several benefits to this approach &#8211; it saves bandwidth, and can reduce the CPU usage on the client&#8217;s machine.</p>
<p>Unfortunately, there&#8217;s been no way to replicate this using <a href="http://jquery.com">jQuery</a>&#8230;until now!</p>
<p>Let&#8217;s take a look at how it works.</p>
<p><strong>Step 1 &#8211; Include the latest version of jQuery and the plugin.</strong></p>
<pre>&lt;script src="jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="jquery.periodicalupdater.js" type="text/javascript"&gt;&lt;/script&gt;</pre>
<p><strong>Step 2 &#8211; call the function with the necessary options and a callback function</strong></p>
<pre>$(document).ready(function(){
   $.PeriodicalUpdater({
      url : 'random.php'
   },
   function(data){
      var myHtml = 'The data returned from the server was: ' + data + '';
      $('#results').append(myHtml);
   });
})</pre>
<p>Here&#8217;s a list of all the options you can set:</p>
<p><strong>url</strong><br />
URL for the ajax request. (Required!)</p>
<p><strong>method</strong><br />
Can be either get or post. (Or GET or POST!)</p>
<p><strong>sendData</strong><br />
Array of values to be passed to the page &#8211; e.g. {name: &#8220;John&#8221;, greeting: &#8220;hello&#8221;}</p>
<p><strong>minTimeout</strong><br />
Starting value for the timeout in milliseconds.</p>
<p><strong>maxTimeout</strong><br />
Maximum length of time between requests.</p>
<p><strong>multiplier</strong><br />
Sets the amount of decay between ajax requests. If this is set to 2, the length of time between each request will double while the response doesn&#8217;t change.</p>
<p><strong>type</strong><br />
Response type &#8211; can be text, xml, json etc &#8211; as with jquery.get or jquery.post.</p>
<p><strong>Step 3 &#8211; Stop the requests!</strong></p>
<p>Finally, you might want to stop ajax requests from PeriodicalUpdater &#8211; you can do so like this (assuming you had a link with id stop):</p>
<pre>$('a#stop').click(function(e){
   e.preventDefault();
   clearTimeout(PeriodicalTimer);
})</pre>
<p>We hope you find this plugin useful. It&#8217;s dual licensed under the <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a> and <a href="http://www.opensource.org/licenses/mit-license.php">MIT licences</a> (just like jQuery), so please read them before you use this plugin.</p>
<p><a href="http://www.360innovate.co.uk/blog/periodical.html">View the demonstration</a></p>
<p><a href="http://www.360innovate.co.uk/blog/jquery.periodicalupdater.js.zip">Download the plugin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.360innovate.co.uk/blog/2009/03/periodicalupdater-for-jquery/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
	</channel>
</rss>

