<?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>dom111.co.uk</title>
	<atom:link href="http://dom111.co.uk/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://dom111.co.uk/blog</link>
	<description>Move along. Nothing to see here.</description>
	<lastBuildDate>Sun, 31 Mar 2013 14:38:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>Can you make your scripts smaller?</title>
		<link>http://dom111.co.uk/blog/coding/can-you-make-your-scripts-smaller/377</link>
		<comments>http://dom111.co.uk/blog/coding/can-you-make-your-scripts-smaller/377#comments</comments>
		<pubDate>Sun, 16 Dec 2012 14:40:19 +0000</pubDate>
		<dc:creator>dom111</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.dom111.co.uk/blog/?p=377</guid>
		<description><![CDATA[Minifying your JavaScript is something most people are familiar with and have to do fairly regularly, whether is reducing your page load time on PC or keeping the files within the mobile cache limits. Having recently seen UglifyJS and having &#8230; <a href="http://dom111.co.uk/blog/coding/can-you-make-your-scripts-smaller/377">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Minifying your JavaScript is something most people are familiar with and have to do fairly regularly, whether is reducing your page load time on PC or keeping the files within the mobile cache limits.</p>
<p>Having recently seen <a href="http://lisperator.net/uglifyjs/" target="_blank">UglifyJS</a> and having used some of the more obvious tricks (!0 === true, !1 === false, etc) myself, I wondered if there was a way you could shrink down what&#8217;s transferred even more&#8230;</p>
<p>As a proof of concept I&#8217;ve knocked up a (hopefully fairly) <a href="/files/symbolise/minify.pl" target="_blank">simple perl script</a> that will wrap your code in a closure and replace a lot of the internal indexes that are used with global symbols, which when compressed with YUI/Uglify should reduce filesize overall.<br />
<span id="more-377"></span><br />
I&#8217;ve already been using this method in bookmarklets, and I&#8217;m sure many others have too, but I couldn&#8217;t find an existing tool to do this (and I thought it would be interesting trying to break JavaScript files down for parsing&#8230;).</p>
<p>In case you don&#8217;t know, the dot notation in JS is just a shorthand for using square brackets:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #000066; font-weight: bold;">var</span> obj <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> <span style="color: #3366CC;">'test'</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'value'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'Hello World!'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    obj.<span style="color: #660066;">test</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// true</span>
    obj<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'test'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// true</span></pre></td></tr></table></div>

<p>which means you can also do:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #000066; font-weight: bold;">var</span> k <span style="color: #339933;">=</span> <span style="color: #3366CC;">'test'</span><span style="color: #339933;">;</span>
    obj<span style="color: #009900;">&#91;</span>k<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// true</span></pre></td></tr></table></div>

<p>In simple bookmarklets I often have a few calls to getElementsByTagName or querySelectorAll which I reference in the main closure as strings in variables like getElementsByTagName__ or querySelectorAll__, so I wanted to see if it was possible to automate this process, and if so how hard it would be.</p>
<p>Well, it was pretty frustrating and I&#8217;m sure it hasn&#8217;t worked out as anywhere near the simplest solution (I am almost certain the regular expressions could be simplified!) but I thought I&#8217;d share in case anyone else thinks the same and could perhaps improve upon this or point me to an existing solution.</p>
<p>Here are some size comparisons using jQuery 1.8.3 as an example.</p>
<p>Standard Library:</p>
<p><a href="/files/symbolise/jquery-raw.js" target="_blank">raw</a>: 331,286 bytes<br />
<a href="/files/symbolise/jquery-min.js" target="_blank">min (jquery.min)</a>: 93,636 bytes<br />
<a href="/files/symbolise/jquery-yui.js" target="_blank">yui</a>: 105,103 bytes<br />
<a href="/files/symbolise/jquery-uglify.js" target="_blank">uglify</a>: 92,604 bytes</p>
<p>Parsed:</p>
<p><a href="/files/symbolise/jquery-parsed.js" target="_blank">raw</a>: 369,687 bytes<br />
<a href="/files/symbolise/jquery-parsed-yui.js" target="_blank">yui</a>: 95,093 bytes<br />
<a href="/files/symbolise/jquery-parsed-uglify.js" target="_blank">uglify</a>: 82,682 bytes</p>
<p>Now there are some drawbacks with my implementation here, it won&#8217;t remove or add to an existing closure, so you might have redundant code at the tope of your file, but as this is just a proof of concept I haven&#8217;t really parsed the JS so I didn&#8217;t want to potentially trash anything&#8230; Also if you rely on being in the global scope (Prototype for example) this will likely break your script. Other than that I haven&#8217;t encountered anything that&#8217;s been broken in this jQuery example by the process, but that certainly doesn&#8217;t <em>mean</em> nothing&#8217;s broken! I&#8217;ve also assumed DOM-centric script, using this as a short reference to the window as the default in minify.pl, but in Symbolise.pm it&#8217;s disabled by default.</p>
<p>Are there any other tricks that could get even more bytes squeezed?</p>
<p>Does gzip totally negate this work? (Probably does, but this was interesting nonetheless!)</p>
<p>If you&#8217;d like to play with this yourself, you can access the <a href="/files/symbolise/minify.pl" target="_blank">perl script here</a> or there&#8217;s a <a href="https://github.com/dom111/symbolise-js" target="_blank">github repository</a>.</p>
<p>To use it, put it in a folder and run:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #c20cb9; font-weight: bold;">perl</span> minify.pl filename.js <span style="color: #000000; font-weight: bold;">&gt;</span> filename-parsed.js</pre></td></tr></table></div>

<p><strong>Edit:</strong> After <a href="http://www.reddit.com/r/javascript/comments/14xy14/help_uglifyjs_shrink_your_js_down_even_more/" target="_blank">posting on reddit</a>, I received a <a href="http://www.reddit.com/r/javascript/comments/14xy14/help_uglifyjs_shrink_your_js_down_even_more/c7hxlwo" target="_blank">couple of</a> <a href="http://www.reddit.com/r/javascript/comments/14xy14/help_uglifyjs_shrink_your_js_down_even_more/c7i5poy" target="_blank">comments about</a> how gzip affects the on-disk numbers:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #007800;">$cat</span> jquery-uglify.js <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> <span style="color: #660033;">-c</span>
    <span style="color: #000000;">33341</span> <span style="color: #666666; font-style: italic;"># 32.49KiB</span>
&nbsp;
    <span style="color: #007800;">$cat</span> jquery-parsed-uglify.js <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> <span style="color: #660033;">-c</span>
    <span style="color: #000000;">34731</span> <span style="color: #666666; font-style: italic;"># 33.85KiB</span></pre></td></tr></table></div>

<p>So gzip <strong>does</strong> totally negate these changes! Which makes sense I suppose from the fact that there&#8217;s extra overhead that can&#8217;t be compressed away (the closure and all the arguments/parameters).</p>
]]></content:encoded>
			<wfw:commentRss>http://dom111.co.uk/blog/coding/can-you-make-your-scripts-smaller/377/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sonic the Hedgehog &#8216;construction cheat&#8217; in JavaScript</title>
		<link>http://dom111.co.uk/blog/coding/sonic-the-hedgehog-construction-cheat-in-javascript/360</link>
		<comments>http://dom111.co.uk/blog/coding/sonic-the-hedgehog-construction-cheat-in-javascript/360#comments</comments>
		<pubDate>Sat, 25 Aug 2012 09:58:44 +0000</pubDate>
		<dc:creator>dom111</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.dom111.co.uk/blog/?p=360</guid>
		<description><![CDATA[I clearly spent a little too long thinking about this, but it was fun nonetheless! I showed my 5-year-old nephew the construction cheat in Sonic the Hedgehog the other weekend and he thoroughly enjoyed printing rocks everywhere on the screen, &#8230; <a href="http://dom111.co.uk/blog/coding/sonic-the-hedgehog-construction-cheat-in-javascript/360">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I clearly spent a little too long thinking about this, but it was fun nonetheless!</p>
<p>I showed my 5-year-old nephew the <abbr title="Up, C, Down, C, Left, C, Right, C, A, B, C, Start [Enter]">construction cheat in Sonic the Hedgehog</abbr> the other weekend and he thoroughly enjoyed printing rocks everywhere on the screen, so I wondered if it would be possible to do something similar in JavaScript, since people love using the Konami code for easter eggs, why not Sonic?</p>
<p>I opted for native javascript, not using any libraries for easy portability.</p>
<p>I&#8217;ve encountered a few issues on some sites that already capture keypresses, but for the most part it&#8217;s worked ok. I&#8217;ve only tested this on Chrome and Firefox (Mac, latest versions) but it should work fine on Windows. No idea about IE&#8230; Probably not, but I did try to use cross-browser methods where applicable!</p>
<p>The <a href="/files/sonic-cc/sonic-cc.js">commented source is here</a> and the script is enabled on the blog so you should be able to use it anywhere.</p>
<p>Have fun!</p>
<p>Oh, here are some sprites for good measure:</p>
<p><img src="/img/sonic/ring.gif" alt="" /> <img src="/img/sonic/box.gif" alt="" /> <img src="/img/sonic/lamppost.gif" alt="" /> <img src="/img/sonic/crab.gif" alt="" /> <img src="/img/sonic/ladybug.gif" alt="" /> <img src="/img/sonic/sign.gif" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://dom111.co.uk/blog/coding/sonic-the-hedgehog-construction-cheat-in-javascript/360/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebDAV file upload bookmarklet</title>
		<link>http://dom111.co.uk/blog/coding/webdav-file-upload-bookmarklet/352</link>
		<comments>http://dom111.co.uk/blog/coding/webdav-file-upload-bookmarklet/352#comments</comments>
		<pubDate>Tue, 07 Aug 2012 19:26:19 +0000</pubDate>
		<dc:creator>dom111</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.dom111.co.uk/blog/?p=352</guid>
		<description><![CDATA[I recently had a discussion with a co-worker as to whether or not it would be possible to upload files to a WebDAV server via AJAX and in doing so discovered it is indeed totally possibly to do so and &#8230; <a href="http://dom111.co.uk/blog/coding/webdav-file-upload-bookmarklet/352">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I recently had a discussion with a co-worker as to whether or not it would be possible to upload files to a WebDAV server via AJAX and in doing so discovered it is indeed totally possibly to do so and so I went on a little bit of a mission and made a pretty basic interface for apache that replaced the standard directory listing and have also made a bookmarklet.</p>
<p>There&#8217;s no demo I&#8217;m afraid, however the bookmarklet should work on just about any WebDAV server (at least, it worked on mine&#8230;), but you won&#8217;t have pretty code highlighting <img src='http://dom111.co.uk/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> .</p>
<p>I&#8217;ve set up a <a href="https://github.com/dom111/webdav-js" onclick="this.target='_blank';">github repository</a> but you can use the <a href="https://github.com/dom111/webdav-js/tree/master/examples/bookmarklet" onclick="this.target='_blank';">bookmarklet directly</a>.</p>
<p>Note: This will almost certainly not work in IE and I&#8217;ve only tested Firefox and Chrome (latest versions).</p>
<p><strong>EDIT</strong>: minor update and moved to GitHub pages instead of using raw which caused problems with the CSS on Firefox.</p>
]]></content:encoded>
			<wfw:commentRss>http://dom111.co.uk/blog/coding/webdav-file-upload-bookmarklet/352/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pop quiz!</title>
		<link>http://dom111.co.uk/blog/coding/pop-quiz/341</link>
		<comments>http://dom111.co.uk/blog/coding/pop-quiz/341#comments</comments>
		<pubDate>Sat, 07 Jul 2012 01:08:20 +0000</pubDate>
		<dc:creator>dom111</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.dom111.co.uk/blog/?p=341</guid>
		<description><![CDATA[An interesting item from stackoverflow via /r/javascript! Why does parseInt(1/0, 18) == NaN, but parseInt(1/0, 19) == 18 and parseInt(1/0, 25) == 185011843? Javascript apparently has the division by zero problem solved, due to (x > 0)/0 being equal to &#8230; <a href="http://dom111.co.uk/blog/coding/pop-quiz/341">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>An interesting item from <a href="http://stackoverflow.com/questions/11340673/why-does-parseint1-0-19-return-18">stackoverflow</a> via <a href="http://www.reddit.com/r/javascript/comments/w4nc2/javascript_why_does_parseint10_19_return_18/">/r/javascript</a>!</p>
<p>Why does <code lang="javascript">parseInt(1/0, 18) == NaN</code>, but <code lang="javascript">parseInt(1/0, 19) == 18</code> and <code lang="javascript">parseInt(1/0, 25) == 185011843</code>?</p>
<p>Javascript apparently has the <a href="http://en.wikipedia.org/wiki/Division_by_zero">division by zero problem</a> solved, due to <code>(x > 0)/0</code> being equal to <code>Infinity</code>, an object (constant?) in JS in the same vein as <code>NaN</code>. It interacts with <code>NaN</code> as well, in that <code lang="javascript">Infinity - Infinity</code> or <code>Infinity / Infinity == NaN</code>, but <code>Infinity + Infinity</code> or <code>Infinity * Infinity == Infinity</code>. Also there&#8217;s -Infinity, just for fun.</p>
<p>When <code lang="javascript">parseInt()</code>ing the value infinity, internally it must run <code lang="javascript">.toString()</code> to get the value which returns <code lang="js">"Infinity"</code>. Base 19 has the numbers <code>0-9</code> and then goes on to the letters<code> a-i </code>(there&#8217;s a table in the <a href="http://stackoverflow.com/questions/11340673/why-does-parseint1-0-19-return-18">stackoverflow article</a>) of which the first letter of <code>"Infinity"</code> matches, returning <code>18</code>, when you up the base to 25, all the letters up to <code>n</code> are parsed turning the &#8216;number&#8217; <code>"Infinity"</code> into <code>185011843</code>. Interestingly that also means that <code>parseInt(Infinity/Infinity, 25) == 14648</code>!</p>
]]></content:encoded>
			<wfw:commentRss>http://dom111.co.uk/blog/coding/pop-quiz/341/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mousetrap &#8211; excellent keyboard shortcuts</title>
		<link>http://dom111.co.uk/blog/coding/mousetrap-excellent-keyboard-shortcuts/335</link>
		<comments>http://dom111.co.uk/blog/coding/mousetrap-excellent-keyboard-shortcuts/335#comments</comments>
		<pubDate>Fri, 06 Jul 2012 17:53:25 +0000</pubDate>
		<dc:creator>dom111</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.dom111.co.uk/blog/?p=335</guid>
		<description><![CDATA[Just discovered a great little library called mousetrap. It enables you to have complex, chained if required, keyboard events bound in a very simple, powerful way with no reliance on an underlying library. Example usage: Mousetrap.bind&#40;'d', function&#40;&#41; &#123; Post.next&#40;&#41;; &#125;&#41;; &#8230; <a href="http://dom111.co.uk/blog/coding/mousetrap-excellent-keyboard-shortcuts/335">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.reddit.com/r/javascript/comments/w34y8/mousetrapjs_gmail_style_keyboard_shortcuts_in_14kb/">Just discovered</a> a great little <a href="http://craig.is/killing/mice">library called mousetrap</a>.</p>
<p>It enables you to have complex, chained if required, keyboard events bound in a very simple, powerful way with no reliance on an underlying library.</p>
<p>Example usage:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">Mousetrap.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'d'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    Post.<span style="color: #660066;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
Mousetrap.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    Post.<span style="color: #660066;">previous</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
Mousetrap.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'x'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    Post.<span style="color: #660066;">delete_selected</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
Mousetrap.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'command+a'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'ctrl+a'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    Post.<span style="color: #660066;">selectAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><a href="http://craig.is/killing/mice">Find out more, test and download it here</a>, or access the <a href="https://github.com/ccampbell/mousetrap">git repository here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dom111.co.uk/blog/coding/mousetrap-excellent-keyboard-shortcuts/335/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better timeouts and intervals with Javascript</title>
		<link>http://dom111.co.uk/blog/coding/better-timeouts-and-intervals-with-javascript/326</link>
		<comments>http://dom111.co.uk/blog/coding/better-timeouts-and-intervals-with-javascript/326#comments</comments>
		<pubDate>Thu, 29 Mar 2012 19:28:30 +0000</pubDate>
		<dc:creator>dom111</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[clearInterval]]></category>
		<category><![CDATA[clearTimeout]]></category>
		<category><![CDATA[setInterval]]></category>
		<category><![CDATA[setTimeout]]></category>

		<guid isPermaLink="false">http://www.dom111.co.uk/blog/?p=326</guid>
		<description><![CDATA[window.setTimeout and window.setInterval don&#8217;t ever seem to have been given any love for a long time. (At least from my limited end-user point of view). I&#8217;ve toyed in the past with a better queuing system for them and having the &#8230; <a href="http://dom111.co.uk/blog/coding/better-timeouts-and-intervals-with-javascript/326">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><code>window.setTimeout</code> and <code>window.setInterval</code> don&#8217;t ever seem to have been given any love for a long time. (At least from my limited end-user point of view). I&#8217;ve toyed in the past with a better queuing system for them and having the ability to run on clear (especially for intervals), but I&#8217;ve actually knocked up a basic script that allows object-oriented timeout events. It still uses the native implementations outside, and I&#8217;m sure that this has probably already been done 100 times, but I still wanted to have a go.</p>
<p>This script extends the return from <code>window.setTimeout</code> and <code>window.setInterval</code> to be an object itself that you can <code>stop()</code> and <code>restart()</code>, preserving the function for further use.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">var</span> t <span style="color: #339933;">=</span> window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>timeout<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// timeout argument is the timeout object itself</span>
    console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'test'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// test</span>
t.<span style="color: #660066;">restart</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// test</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">var</span> s <span style="color: #339933;">=</span> window.<span style="color: #660066;">setInterval</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>interval<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// interval argument is the interval object itself</span>
    Messages.<span style="color: #660066;">check</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Interval</span>
s.<span style="color: #660066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Interval</span>
s.<span style="color: #660066;">complete</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// 9</span>
s.<span style="color: #660066;">cancelled</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// 1</span></pre></td></tr></table></div>

<p><strong>Please note:</strong> I&#8217;ve only really tested this in Chrome! I can&#8217;t see why it wouldn&#8217;t work in other browsers, I guess maybe some of these would be protected, but I&#8217;m not sure&#8230; If that&#8217;s the case, it wouldn&#8217;t be too difficult to utilise the alternative <code>new Timeout(function(){ }, 400);</code> syntax&#8230;</p>
<p>There&#8217;s a bit more (not much!) <a href="/files/timeout/" title="Better timeout and intervals with Javascript">of an explanation here</a> and <a href="/files/timeout/timeouts.zip">the code is available here</a>. There are no prerequisites for this code, should run on plain old Javascript.</p>
<p><strong>Edit</strong>: Minor update to the script to include the object in the callback.</p>
]]></content:encoded>
			<wfw:commentRss>http://dom111.co.uk/blog/coding/better-timeouts-and-intervals-with-javascript/326/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Parallax: In action</title>
		<link>http://dom111.co.uk/blog/coding/jquery-parallax-in-action/319</link>
		<comments>http://dom111.co.uk/blog/coding/jquery-parallax-in-action/319#comments</comments>
		<pubDate>Sun, 18 Mar 2012 09:24:25 +0000</pubDate>
		<dc:creator>dom111</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jquery parallax]]></category>
		<category><![CDATA[parallax]]></category>

		<guid isPermaLink="false">http://www.dom111.co.uk/blog/?p=319</guid>
		<description><![CDATA[A lot of the traffic I get to this blog is related to the jQuery Parallax script I wrote quite some time ago. Looking at the code now, I don&#8217;t think I&#8217;d change too much about it, perhaps use .on('mousemouse', &#8230; <a href="http://dom111.co.uk/blog/coding/jquery-parallax-in-action/319">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A lot of the traffic I get to this blog is related to <a href="/blog/coding/jquery-parallax-0-2-minor-updates/125">the jQuery Parallax script I wrote quite some time ago</a>. Looking at the code now, I don&#8217;t think I&#8217;d change too much about it, perhaps use <code>.on('mousemouse', ...)</code> instead of <code>.mousemove()</code>, but mostly it seems to serve it&#8217;s function quite well. Since the only real functions being called are <code>.mousemove()</code> and <code>.css()</code> it should still be working with the latest versions of jQuery and unless they decide to majorly change the API, it should continue to work too!</p>
<p>Since my example was on a fairly empty page, I thought I&#8217;d link to a couple of sites that are using it in the real world:</p>
<ul>
<li><a href="http://www.lunaii-dollmaker.com/" target="_blank">Lunaii-dollmaker.com</a> &#8211; a great header, excellent style</li>
<li><a href="http://attackemart.in/" target="_blank">Attackemart.in</a> &#8211; a great idea utilising horizontal and vertical movement</li>
<li><a href="http://lsd.in.ua/" target="_blank">lsd.in.ua</a> &#8211; a good example on the homepage</li>
</ul>
<p>If you&#8217;re using the script and think your sites is a good example of utilising the parallax effect, please leave me a message!</p>
]]></content:encoded>
			<wfw:commentRss>http://dom111.co.uk/blog/coding/jquery-parallax-in-action/319/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tool: Fix broken unicode characters</title>
		<link>http://dom111.co.uk/blog/coding/tool-fix-broken-unicode-characters/312</link>
		<comments>http://dom111.co.uk/blog/coding/tool-fix-broken-unicode-characters/312#comments</comments>
		<pubDate>Tue, 13 Mar 2012 19:56:08 +0000</pubDate>
		<dc:creator>dom111</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[fix broken unicode]]></category>
		<category><![CDATA[fix broken utf-8]]></category>
		<category><![CDATA[fix broken utf8]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[unicode encoding]]></category>
		<category><![CDATA[utf-8 encoding]]></category>
		<category><![CDATA[utf8 encoding]]></category>

		<guid isPermaLink="false">http://www.dom111.co.uk/blog/?p=312</guid>
		<description><![CDATA[So in the past I&#8217;ve had many a nightmare receiving garbled unicode characters in an email or in a poorly encoded database field, so I&#8217;ve written a basic tool that works with some of the most common Western European characters &#8230; <a href="http://dom111.co.uk/blog/coding/tool-fix-broken-unicode-characters/312">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>So in the past I&#8217;ve had many a nightmare receiving garbled unicode characters in an email or in a poorly encoded database field, so I&#8217;ve written a basic tool that works with some of the most common Western European characters and will correctly convert them (optionally to their closest matching standard ASCII character).</p>
<p>I am going to try and work on a full set (that can be incrementally loaded), but this has been sufficient for my needs so far.</p>
<p><a href="/files/utf8" title="Broken UTF-8/Unicode fixer">Use it here</a>!</p>
<p><strong>Edit</strong>: I&#8217;ve updated the Tool to allow for various functions, input via literals (\x0d or \u02f4), returning to multibyte in the text area and other fixes. The same link will work.</p>
<p><a href="http://www.utf8-chartable.de/unicode-utf8-table.pl" target="_blank">This link</a> was incredibly helpful with my investigation and testing!</p>
]]></content:encoded>
			<wfw:commentRss>http://dom111.co.uk/blog/coding/tool-fix-broken-unicode-characters/312/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bookmarklet: Reload CSS files without reloading the page</title>
		<link>http://dom111.co.uk/blog/coding/bookmarklet-reload-css-files-without-reloading-the-page/304</link>
		<comments>http://dom111.co.uk/blog/coding/bookmarklet-reload-css-files-without-reloading-the-page/304#comments</comments>
		<pubDate>Tue, 13 Mar 2012 19:30:07 +0000</pubDate>
		<dc:creator>dom111</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[reload css]]></category>

		<guid isPermaLink="false">http://www.dom111.co.uk/blog/?p=304</guid>
		<description><![CDATA[Working on styling the contents of popup windows can be frustrating and laborious. But not if you can just reload the CSS&#8230; This bookmarklet will reload all the associated stylesheets in the current document. It looks for all &#60;link/&#62; elements &#8230; <a href="http://dom111.co.uk/blog/coding/bookmarklet-reload-css-files-without-reloading-the-page/304">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Working on styling the contents of popup windows can be frustrating and laborious. But not if you can just reload the CSS&#8230;</p>
<p>This bookmarklet will reload all the associated stylesheets in the current document. It looks for all <code>&lt;link/&gt;</code> elements with <code>rel="stylesheet"</code>, removes from the DOM and re-adds them appending a ?_=1234567890 (or &amp;_ depending on the URL, where the numbers represent the JS timestamp) into the <code>&lt;head/&gt;</code>.</p>
<p>Hopefully this will help someone suffering similar pain to myself!</p>
<p><a title="Reload CSS" href='javascript:(function(g,d,b,f,a,c,e){var h=g[d]("head")[0],k=g[d]("link"),j=[];for(;e<k[c];e++){if(k[e][a][b]()[f](/\.css/)){j.push(k[e].cloneNode(!1));k[e].parentNode.removeChild(k[e]);e--}}while(j[c]){j[0][a]=j[0][a][b]().replace(/([&#038;\?])_=\d+/,"");j[0][a]=j[0][a]+(j[0][a][b]()[f](/\?/)?"&#038;":"?")+"_="+Date.now()[b]();h.appendChild(j.shift())}})(document,"getElementsByTagName","toString","match","href","length",0);'>Reload CSS</a> (Add the link to the left to your bookmarks to use!)</p>
<p><strong>Please note</strong>: I haven&#8217;t tested this in IE, but surely it&#8217;ll work&#8230; Right?</p>
<p><span id="more-304"></span></p>
<p>Full commented code:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>document<span style="color: #339933;">,</span> getElementsByTagName<span style="color: #339933;">,</span> toString<span style="color: #339933;">,</span> match<span style="color: #339933;">,</span> href<span style="color: #339933;">,</span> length<span style="color: #339933;">,</span> i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">var</span> head <span style="color: #339933;">=</span> document<span style="color: #009900;">&#91;</span>getElementsByTagName<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'head'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        links <span style="color: #339933;">=</span> document<span style="color: #009900;">&#91;</span>getElementsByTagName<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        store <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// iterate over all the existing s</span>
    <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> links<span style="color: #009900;">&#91;</span>length<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// if it's a stylesheet</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>links<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>href<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>toString<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>match<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\.css/</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">// clone the element, false is needed as Firefox requires the deep flag</span>
            store.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>links<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">cloneNode</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// then remove it from the DOM</span>
            links<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">removeChild</span><span style="color: #009900;">&#40;</span>links<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// decrement i, because links is a NodeList (not an array) and when the element is</span>
            <span style="color: #006600; font-style: italic;">// removed from the DOM, it is also removed from the NodeList</span>
            i<span style="color: #339933;">--;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// iterate over the stored items</span>
    while <span style="color: #009900;">&#40;</span>store<span style="color: #009900;">&#91;</span>length<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// strip out any previous cachebusting querystring</span>
        store<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>href<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> store<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>href<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>toString<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/([&amp;\?])_=\d+/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        store<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>href<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> store<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>href<span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>store<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>href<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>toString<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>match<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\?/</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">'&amp;'</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'?'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'_='</span> <span style="color: #339933;">+</span> <span style="">Date</span>.<span style="color: #660066;">now</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>toString<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// put the element in the </span>
        head.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>store.<span style="color: #660066;">shift</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>document<span style="color: #339933;">,</span> <span style="color: #3366CC;">'getElementsByTagName'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'toString'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'match'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'href'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'length'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://dom111.co.uk/blog/coding/bookmarklet-reload-css-files-without-reloading-the-page/304/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prototype 1.6: Event.live</title>
		<link>http://dom111.co.uk/blog/coding/prototype-1-6-event-live/295</link>
		<comments>http://dom111.co.uk/blog/coding/prototype-1-6-event-live/295#comments</comments>
		<pubDate>Wed, 26 Oct 2011 16:33:30 +0000</pubDate>
		<dc:creator>dom111</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Prototype]]></category>

		<guid isPermaLink="false">http://www.dom111.co.uk/blog/?p=295</guid>
		<description><![CDATA[I&#8217;ve recently been using Prototype 1.6 and had a need for a jQuery.live() clone. The following code appears to emulate mouse events well (form submits [and maybe more...] do not work in IE): Event.live = function&#40;s, e, f&#41; &#123; Event.observe&#40;document, &#8230; <a href="http://dom111.co.uk/blog/coding/prototype-1-6-event-live/295">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve recently been using Prototype 1.6 and had a need for a jQuery.live() clone. The following code appears to emulate mouse events well (form submits [and maybe more...] do not work in IE):</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">Event.<span style="color: #660066;">live</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>s<span style="color: #339933;">,</span> e<span style="color: #339933;">,</span> f<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    Event.<span style="color: #660066;">observe</span><span style="color: #009900;">&#40;</span>document<span style="color: #339933;">,</span> e<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Element.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">target</span><span style="color: #339933;">,</span> s<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>f.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">target</span><span style="color: #339933;">,</span> event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                event.<span style="color: #660066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>To use this run something like the following:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">Event.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div#doesnt_exist_yet a.button'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// run this when the button is clicked</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://dom111.co.uk/blog/coding/prototype-1-6-event-live/295/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
