<?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>Electric Fairground</title>
	<atom:link href="http://www.electricfairground.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.electricfairground.com</link>
	<description>Oom pa pa Oom pa pa</description>
	<lastBuildDate>Thu, 13 Jan 2011 13:28:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Twitter quote aggregator</title>
		<link>http://www.electricfairground.com/2011/01/13/twitter-quote-aggregator/</link>
		<comments>http://www.electricfairground.com/2011/01/13/twitter-quote-aggregator/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 13:28:36 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<guid isPermaLink="false">http://www.electricfairground.com/?p=125</guid>
		<description><![CDATA[I&#8217;ve written a little script that pulls quotes tagged with #quote from twitter&#8217;s stream. You can take a look at 9quotes.com]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written a little script that pulls quotes tagged with #quote from twitter&#8217;s stream. You can take a look at <a href="http://9quotes.com/">9quotes.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricfairground.com/2011/01/13/twitter-quote-aggregator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hidden Message In Blog Source Code</title>
		<link>http://www.electricfairground.com/2010/09/05/hidden-message-in-blog-source-code/</link>
		<comments>http://www.electricfairground.com/2010/09/05/hidden-message-in-blog-source-code/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 23:38:15 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<guid isPermaLink="false">http://www.electricfairground.com/?p=118</guid>
		<description><![CDATA[I&#8217;ve read about hidden messages in source code before, but I think I&#8217;ve just found an original hidden message after looking through the source code for a site: You can check it out yourself at static income daily. I think &#8230;<p class="read-more"><a href="http://www.electricfairground.com/2010/09/05/hidden-message-in-blog-source-code/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve read about hidden messages in source code before, but I think I&#8217;ve just found an original hidden message after looking through the source code for a site:</p>
<pre class='brush: html'>
<div id="container">
<!--
Warning for designers/developers:
Do not work for this guy . . . ever.
I completed what he originally asked for, yet he continues to add feature after feature and I've still not been paid.
This guy is not worth it. He will tell you that he "just wants one more thing" but you will be adding thing after thing and you when you get paid it will too little too late.
You've been warned!!
-->
<div id="posts">
</div>
</div>
</pre>
<p>You can check it out yourself at <a href="http://staticincomedaily.com">static income daily</a>.</p>
<p>I think this is something we should all do. How many clients check the source code?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricfairground.com/2010/09/05/hidden-message-in-blog-source-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brighton Letting Agent Phone Numbers &amp; Fees</title>
		<link>http://www.electricfairground.com/2010/08/24/brighton-letting-agent-phone-numbers-fees/</link>
		<comments>http://www.electricfairground.com/2010/08/24/brighton-letting-agent-phone-numbers-fees/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 13:11:33 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<guid isPermaLink="false">http://www.electricfairground.com/?p=116</guid>
		<description><![CDATA[I&#8217;m planning to move to Brighton pretty soon and my girlfriend and I spent a long time yesterday ringing round all of the Brighton letting agents (including Hove) asking about their fees and whether they accept a guarantor letter or &#8230;<p class="read-more"><a href="http://www.electricfairground.com/2010/08/24/brighton-letting-agent-phone-numbers-fees/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m planning to move to Brighton pretty soon and my girlfriend and I spent a long time yesterday ringing round all of the Brighton letting agents (including Hove) asking about their fees and whether they accept a guarantor letter or not.</p>
<p>Hopefully this will prove useful to someone else who is looking to move to Brighton. Sorry the format is a bit weird &#8211; I just pasted it straight from an XLS file. Let me know if you want the full xls file instead.</p>
<p>Disclaimer: this info is correct as of 24/8/10 but it may well change and I don&#8217;t intend to update this list at all. So please check before you sign any contracts.</p>
<p><strong>Name	Tel (01273)	Fees (per person)	Do They Accept a Guarantor?</strong></p>
<p>Khalil	735904	£125 employed £80 unemployed	Yes</p>
<p>Property Moves	321333		Yes</p>
<p>Brighton Accommodation Agency	0845 873 8126</p>
<p>2Let	220144</p>
<p>Kendrick	699600	£155 everything	Yes</p>
<p>Martin &#038; co	607698</p>
<p>John Hilton	608151</p>
<p>Harringtons	724000	£150, month&#8217;s rent in advance and month&#8217;s rent deposit	Yes, for both</p>
<p>Countrywide	329776</p>
<p>King &#038; Chasemore	606303</p>
<p>GK Whites	606060	£125	Yes</p>
<p>Foundations	626258</p>
<p>Just Lets	208020	£150</p>
<p>Oakley	688882	£125	Yes</p>
<p>Stephen William &#038; co	686477</p>
<p>Cambridge Residential	204037</p>
<p>Brighton Homes	672333</p>
<p>Leaders (Fiveways)	561534</p>
<p>Michael Joseph Estates	748828	£152.75	Yes</p>
<p>Parks	202089	£120 pp + £95 household	Yes but need evidence</p>
<p>Tingleys	710038</p>
<p>Your Move	778588	£150	Yes</p>
<p>Brand Vaughan	205550		Yes</p>
<p>Massey	727278</p>
<p>Direct Lettings	324535</p>
<p>Storm	710005</p>
<p>Wilkins	207208	£165 + vat	yes</p>
<p>PJ Palmers	771115	£125 + vat	yes</p>
<p>01 Property Letting	915101	£125 + one off £65	yes</p>
<p>Tanat Jones	207207	£176.25	yes</p>
<p>Spencer &#038; lee	565566	£125+vat	yes</p>
<p>Northwood	715890</p>
<p>Home Leasing	323344	£130	depends on landlord</p>
<p>Paul Andrew	732362	£115	accidentally lied and said we all worked</p>
<p>St James Lettings	483434	£100 + £20 for guarantor	yes</p>
<p>Barry Alderton	570242</p>
<p>Bonetts	677365	£125+vat	yes</p>
<p>The Property SHop	915400	£70 total for tenancy agreement + £100 total for credit check	forgot to check</p>
<p>BN3 Homes	771155</p>
<p>Lanes Lettings	600068</p>
<p>Pavillion	686306	£150	yes</p>
<p>Rand &#038; co	417 788</p>
<p>Sawyer &#038; co	778844</p>
<p>Let It Bee	220003	£170 + £55 (for 2 bed inventory)	yes</p>
<p>David Webb	300 525</p>
<p>Amberstone	252 858	£150 for first person + £50 per person after	yes</p>
<p>Hove Lets	735555	£150+vat	yes (£75+vat)</p>
<p>Brian Marshall	583453</p>
<p>Calaways	735237	£188	yes</p>
<p>Let’s Go	236547</p>
<p>Mishon Mackey	670 067</p>
<p>Priors	737586		</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricfairground.com/2010/08/24/brighton-letting-agent-phone-numbers-fees/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Worst Example of Web Form Validation Ever</title>
		<link>http://www.electricfairground.com/2009/11/20/the-worst-example-of-web-form-validation-ever/</link>
		<comments>http://www.electricfairground.com/2009/11/20/the-worst-example-of-web-form-validation-ever/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 14:12:23 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<guid isPermaLink="false">http://www.electricfairground.com/?p=95</guid>
		<description><![CDATA[I make websites. I spend a lot of my time thinking about how to make websites more user-friendly and efficient. As a result of this, whenever I see a website that has an extraordinarily bad user interface it makes me &#8230;<p class="read-more"><a href="http://www.electricfairground.com/2009/11/20/the-worst-example-of-web-form-validation-ever/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I make websites. I spend a lot of my time thinking about how to make websites more user-friendly and efficient. As a result of this, whenever I see a website that has an extraordinarily bad user interface it makes me angry. This particular example of eye-watering inefficiency came in a letter from Camden Borough Town Hall (my local council).<span id="more-95"></span></p>
<p><img class="alignnone size-full wp-image-98" title="Form validation in the post" src="http://www.ElectricFairground.com/wp-content/camden1.jpg" alt="Form validation in the post" /></p>
<p>I&#8217;m sorry for the poor quality but this was taken on my phone. For the sake of accessibility I&#8217;ll copy out the important bit below:</p>
<p>&#8220;Thank you for registering for my revenues and benefits.</p>
<p>Unfortunately I am unable to process your request for the following reason(s)</p>
<p>You have not provided an email address.<br />
Please try registering on-line again and ensure you provide a valid email address.&#8221;</p>
<p>I&#8217;ve also included a screenshot of the page this validation error came from. The email field is not marked compulsory. I wonder how many of these letters they have to send out and how big a dent in the council&#8217;s budget this makes. Perhaps if they stopped sending out these letters they could afford a half-decent UX Designer.</p>
<p><img class="alignnone size-full wp-image-100" title="Camden council web form disaster" src="http://www.ElectricFairground.com/wp-content/camden2.png" alt="Camden council web form disaster" width="832" height="684" /></p>
<p>Words cannot describe how stupid this is. This form is five pages long and I didn&#8217;t find out it hadn&#8217;t processed properly for a whole week! Infuriatingly, I was trying to pay these people tax, some of which has presumably previously been used to pay whichever &#8220;web professional&#8221; came up with this crackpot system.</p>
<p>I couldn&#8217;t help thinking what would happen if all websites took the &#8220;Secret Compulsory Fields&#8221; (SCF) approach to form design. Instead of a book from Amazon you get a letter two weeks later listing the errors on your registration form, or you try and order your groceries online and instead of a food delivery you get a polite letter informing you that your password didn&#8217;t meet the minimum eight characters.</p>
<p>The only way this form validation could have been worse is if it had been sent by <i>fucking carrier pigeon</i>. If you&#8217;re reading this Camden Council: that wasn&#8217;t a serious suggestion. For God&#8217;s sake please don&#8217;t waste any more of my time and money.</p>
<h2>Update: Response From Camden Council</h2>
<p>First of all, we apologize for not noticing your complaint sooner. We do encourage our users to give us feedback using our feedback form so we can improve delivery of services in a more efficient and timely manner.</p>
<p>In response to your complaint, yes we do feel that this service could have been delivered more efficiently. We try not to use validation unless absolutely necessary, especially in the case of requiring emails address from groups of people that might belong to the most socially-deprived sections of the community. It is likely that many people using ‘register for my revenues and benefits’ come from just this group.</p>
<p>We have spoken to the service to understand why they think they need an email address to provide the online service. They have agreed to remove the mandatory email field and contacted our supplier. The necessary adjustments will be made soon. If you have any further suggestions or complaints about our services, please follow the complaints and suggestions link to see how you can do this.</p>
<p>Many thanks for your feedback.</p>
<p>The Webteam</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricfairground.com/2009/11/20/the-worst-example-of-web-form-validation-ever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beware of the &amp; (ampersand) character when parsing XML using PHP&#8217;s SimpleXML</title>
		<link>http://www.electricfairground.com/2009/11/15/beware-of-the-ampersand-character-when-parsing-xml-using-phps-simplexml/</link>
		<comments>http://www.electricfairground.com/2009/11/15/beware-of-the-ampersand-character-when-parsing-xml-using-phps-simplexml/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 18:06:47 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<guid isPermaLink="false">http://www.electricfairground.com/2009/11/15/beware-of-the-ampersand-character-when-parsing-xml-using-phps-simplexml/</guid>
		<description><![CDATA[If you are getting errors like &#8220;parser error : EntityRef: expecting &#8216;;&#8217;&#8221; when trying to parse some XML using SimpleXML, it could be because your XML file or string contains an &#038; character. Do the following to remedy the situation: &#8230;<p class="read-more"><a href="http://www.electricfairground.com/2009/11/15/beware-of-the-ampersand-character-when-parsing-xml-using-phps-simplexml/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>If you are getting errors like &#8220;parser error : EntityRef: expecting &#8216;;&#8217;&#8221; when trying to parse some XML using SimpleXML, it could be because your XML file or string contains an &#038; character. Do the following to remedy the situation:</p>
<pre class="brush: php">
$correct_xml = str_replace('&#038;','&#38;amp;',$problem_xml);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.electricfairground.com/2009/11/15/beware-of-the-ampersand-character-when-parsing-xml-using-phps-simplexml/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ajax content, jQuery page transitions and why you should ditch the browser refresh</title>
		<link>http://www.electricfairground.com/2009/10/31/ajax-content-jquery-page-transitions-and-why-you-should-ditch-the-browser-refresh/</link>
		<comments>http://www.electricfairground.com/2009/10/31/ajax-content-jquery-page-transitions-and-why-you-should-ditch-the-browser-refresh/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 16:02:07 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<guid isPermaLink="false">http://www.electricfairground.com/?p=72</guid>
		<description><![CDATA[I’ve just finished a project I’ve been working on over the last couple of months that was a jQuery-based ajax application without page refreshes. I thought I’d take this opportunity to share some of the problems I encountered whilst they &#8230;<p class="read-more"><a href="http://www.electricfairground.com/2009/10/31/ajax-content-jquery-page-transitions-and-why-you-should-ditch-the-browser-refresh/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div id="attachment_73" class="wp-caption alignnone" style="width: 363px"><img class="size-full wp-image-73" title="no browser refresh" src="http://www.ElectricFairground.com/wp-content/link-trading-prohibited.gif" alt="no browser refresh" width="353" height="261" /><p class="wp-caption-text">Down with the browser refresh</p></div>
<p>I’ve just finished a project I’ve been working on over the last couple of months that was a jQuery-based ajax application without page refreshes. I thought I’d take this opportunity to share some of the problems I encountered whilst they were still fresh in my mind.</p>
<p>If you’re thinking of making your own jQuery online app I’d recommend trying out the ‘no refresh’ method. Once you’ve got it working, you’ll wonder how you’ve managed to cope so long with all these page refreshes, and each time somebody else’s site forces your browser to refresh, you’ll throw up a bit in your mouth.</p>
<p>In my humble opinion, asynchronous data transfer is the future and soon it will be very unusual to have your page refresh every time you want to see new content. Browser refreshes are clunky, ugly are an unnecessary interruption to the user experience flow.</p>
<p>With jQuery and ajax ruling your content you can have:</p>
<p><span id="more-72"></span></p>
<ul>
<li>Complete control over the user experience. While your user is waiting for a page to load, you can display a fancy loading graphic, or even a small film clip, or some music, or whatever you like. It makes for a much smoother page transition, which should have it’s own bullet . .</li>
<li>Smooth page transitions. Okay, this is part of the user experience too, but such an important part I thought it deserved a special mention. Instead of content loading, then appearing in drips and drabs as and when it finishes, you can display your loading graphic until the whole page is ready, and then use a pretty jQuery effect to display the new content. You can have the page slide in, gradually fade in or just appear, the point is the page is ready instantly, and the user is aware that they can now click on things and type.</li>
</ul>
<p>“But what about all the disadvantages!?” I hear you cry. Well, yes, you’re right there are problems too, but I’m going to try and address these with solutions and workarounds I’ve been using.</p>
<p><img src="http://www.oucs.ox.ac.uk/rts/xaira/Doc/images/browser01.jpg" alt="xml in a browser" /></p>
<h2>Problem #1 &#8211; You click on a link and your browser takes you straight to the content, but refreshes the page in the process. Bad browser! Bad!</h2>
<p>If you’re building an ajax app, this is a big nono. Especially since it’s most likely that that page will have no layout, and just be some JSON/XML data.</p>
<p>The solution is to use a jQuery event handler to intercept the link and make it do what you want, overriding the default behaviour.</p>
<p>Tip: For my application, I added classes to each link element such as a.internal and a.external to distinguish between the two. If you don’t do this, external links will be loaded in your application instead of in a new tab/page. You can also add separate behaviour for external links then, such as displaying a popup informing the user they are leaving your site.</p>
<pre class='brush: js'>

$('a.internal').live('click',function() {
var post_url = $(this).attr('href');
$.historyLoad(post_url);
return false;
});
</pre>
<p>This bit of jQuery should go in the $(document).ready section of your code. It intercepts all links clicked of which have the class &#8216;internal&#8217;, sends their &#8216;href&#8217; attribute to the historyLoad function, and then returns false to prevent the link from opening a new page.</p>
<p>But that&#8217;s not the only problem you&#8217;re likely to encounter.</p>
<div class="wp-caption alignnone" style="width: 809px"><img title="Empty browser" src="http://img198.imageshack.us/img198/6195/26821035.jpg" alt="empty browser" width="799" height="624" /><p class="wp-caption-text">empty browser</p></div>
<h2>Problem #2 &#8211; You scroll halfway down the page, click on a link and the content loads above the point your looking at.</h2>
<p>If you’re displaying a lot of content, that requires vertical scrolling, you might find that when you click on a link to a page displayer less content, this content gets injected above the browser’s viewport. In other words, the new page is shorter than the old one and you need to scroll up to view it.</p>
<p>If you’ve never heard of ajax or jQuery before, you’re probably not going to realise that simply scrolling up will solve this one, so it’s good practice to cater for these people.</p>
<p>There is a simple solution to this. Add the following code to your ajax ‘success’ function &#8211; the function that gets called when your ajax call returns with some data.</p>
<pre class='brush: js'>

$('html, body').animate({scrollTop:0}, 'fast');
</pre>
<p>This will take the user back to the top of the page before the new content is injected.</p>
<h2>
<div class="wp-caption alignnone" style="width: 810px"><img title="Start from the beginning" src="http://www.lookerslandrover.co.uk/live/images/cme_resources/Public/Sign-Posts.jpg" alt="Start again from the beginning" width="800" height="536" /><p class="wp-caption-text">Start again from the beginning</p></div></h2>
<h2>Problem #3 &#8211; going straight to a page deep in your application’s navigation structure.</h2>
<p>So, you want to load up a bookmark you have from an article you read on the site six months ago? But wait! It just takes you to the home page and you need to wade through the navigation to get back to this article.</p>
<p>Because the page isn’t refreshing, neither is your browser registering the fact that you’ve changed pages. There is a workaround for this involving adding a unique hash code to the url using a nice little jQuery plugin. <a href="http://www.electricfairground.com/2009/10/01/restoring-conventional-page-navigation-to-your-javascript-application-with-jquery-history-plugin/" target="_blank">Please read my tutorial on the subject</a> for more details, or google ‘jQuery history plugin’.</p>
<p><div class="wp-caption aligncenter" style="width: 380px"><img title="Lorries overtaking" src="http://www.grannybuttons.com/granny_buttons/images/granny_buttons_overtaking_a_truckload_of_straw-thumb.jpg" alt="No room for overtaking here" width="370" height="257" /><p class="wp-caption-text">No room for overtaking here</p></div>
<h2>Problem #4 &#8211; Ajax requests jumping the queue</h2>
<p>I didn&#8217;t encounter this problem for quite a while, but if you&#8217;ve got a page running without refreshes, chances are you&#8217;ll experience the same problem.</p>
<p>In jQuery, there&#8217;s no &#8220;request stack&#8221; or &#8220;request queue&#8221; for ajax. When you send off an ajax request, it comes back after the data you are rquesting has loaded, and only then.</p>
<p>Consider what might happen if you first click on a link for a page with 1000 images listed in one big row, and then get bored of waiting for this to load and click on a link for a single image. When you click on the second link (the one for the single image), it will not cancel the first request. So now you have two requests being processed by your server. Naturally, the single image is going to come back first. Great! That&#8217;s what we wanted. But as soon as the 1000 images have loaded, the &#8216;success&#8217; function will get called and you&#8217;ll find your viewing experience unexpectantly interrupted.</p>
<p>To fix this you need to cancel any previous ajax requests before you initiate a new one. To do this, first declare a global variable to hold the details of any ajax requests your application will make:</p>
<pre class='brush: js'>

var ajax_request = null;
</pre>
<p>This makes a variable that we can reference lateron to see if an ajax request is under way. Once we&#8217;ve got this we can create our ajax request:</p>
<pre class='brush: js'>

if (ajax_request) { // checks for an existing ajax request
ajax_request.abort(); // aborts request
}
ajax_request = $.ajax({ // start the AJAX request
type: "POST", // I'm sending it via POST, you can use GET if you're feeling dangerous
url: post_url, // the URL we are retrieving
data: null, // in this case we are not sending any data
success: function(data) { // execute the below if the AJAX goes according to plan
//alert("success!");

// you can now inject the ajax response into any element you like witht the 'data' variable

});
});
},
error: function (XMLHttpRequest, textStatus, errorThrown) { // execute this if it all goes tits up
alert(textStatus + errorThrown);
return false;
}
});
</pre>
<p>In this example, the ajax request will be sent regardless, but jQuery will cancel any previous requests, to avoid the requests overtaking eachother.</p>
<p>Tip: If you would like more complex queue behaviour it might be worth checking out the<a href="http://plugins.jquery.com/project/ajaxqueue" target="_blank"> jQuery Ajax Queue plugin</a>.</p>
<p>Do you think this is all bullshit? That the browser refresh is here to stay? Or have you encountered other problems when ajaxifying your own website?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricfairground.com/2009/10/31/ajax-content-jquery-page-transitions-and-why-you-should-ditch-the-browser-refresh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Restoring conventional page navigation to your javascript application with jQuery history plugin</title>
		<link>http://www.electricfairground.com/2009/10/01/restoring-conventional-page-navigation-to-your-javascript-application-with-jquery-history-plugin/</link>
		<comments>http://www.electricfairground.com/2009/10/01/restoring-conventional-page-navigation-to-your-javascript-application-with-jquery-history-plugin/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 19:56:03 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<guid isPermaLink="false">http://www.electricfairground.com/?p=61</guid>
		<description><![CDATA[I&#8217;m not sure how, but my jQuery application suddenly got very complicated. One minute I was adding cool onmouseover effects and then BANG I&#8217;m inserting new elements all over the place and I have to look into heavy compression just &#8230;<p class="read-more"><a href="http://www.electricfairground.com/2009/10/01/restoring-conventional-page-navigation-to-your-javascript-application-with-jquery-history-plugin/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure how, but my jQuery application suddenly got very complicated. One minute I was adding cool onmouseover effects and then BANG I&#8217;m inserting new elements all over the place and I have to look into heavy compression just to get the thing to download this side of the apocalypse.</p>
<p>Browsing through my application is a breeze. All the links are rewired to AJAX requests with smooth transitions and lots of slideUp-and-downs. There&#8217;s one glaring hole that might just bring this happy user experience down quicker than a Lehman brother wearing Iron Boots.</p>
<p>Whenever my lovely users click &#8216;back&#8217; on their browser they get taken back to the obscenity that is the non-standards-compliant flashing gif-ridden site they came from, not the last thing they were viewing on my site. And if he or she clicks ‘refresh’ the application state goes back to the original and my user has to navigate back to the page he or she was viewing all over again. What a knightmare.</p>
<p>The browser navigation controls &#8211; back, forwards and refresh &#8211; are a staple of any user&#8217;s experience. Of course, being a web developer you will recognise the lack of page refreshes and the changing of page elements and automatically look for site-specific navigation links on the page itself. However, your average user is going to get very confused, thinking their browser buttons are broken or worse &#8211; your website is broken.</p>
<p>And it&#8217;s not only the user that&#8217;s going to encounter problems. If a Google Spider can’t see pages with unique URLs it’s not going to index them. So all I’m going to get on a Google search is whatever is on the landing page, which is just header information and a footer &#8211; not very useful. If my user wants to bookmark a page for later, he or she is going to have to start again, before all the AJAX fun began. The list goes on. It&#8217;s like building a vast palace with turrets and different wings but neglecting to build any doors. Your guests are going to walk over the drawbridge and marvel at the splendour of your architecture, the complete set of Power Ranger themed bedrooms, yet have no idea how to get there.</p>
<p>Anyway, here&#8217;s how I solved it:</p>
<p><span id="more-61"></span></p>
<h2>Step 1: jQuery history plugin</h2>
<p>First of all, I downloaded the <a href="http://www.mikage.to/jquery/jquery_history.html">Mikage’s jQuery history plugin</a>. This is a bit of code that allows me to write to my browser’s history using a hash key. This hash can be pretty much anything that can uniquely describe your application&#8217;s state. I chose to make it the same as the resource I was loading into the main part of my application. So the plugin would add &#8216;www.mysite.com/page1#page2&#8242; to my browser history when I clicked on the &#8216;Page 2&#8242; link. Once I’d saved the plugin to my computer, I put this line in my head section of page1.html.</p>
<pre class='brush: js'>

&lt;script src='http://www.mysite.com/js/jquery.history.js' type='text/javascript'&gt;&lt;/script&gt;
</pre>
<p>Now that jQuery knows I want to use this plugin, I need to initialise before I can start using it. I put this line just below the previous line, also in the $(document.ready()) section.</p>
<pre class='brush: js'>
$(document).ready(function() {

$.historyInit(ajaxRender, 'http://www.mysite.com/page1');
};
</pre>
<p>Right, now it’s ready to use.</p>
<h2>Step 2: The click event</h2>
<p>Thinking about it, the page state always changes directly after the user clicks on a link (as it would on any other site I guess). So each of these state changes is tied to an &lt;a&gt; element. Therefore, I’m going to use jQuery’s live() function to tie a function to each link element’s ‘click’ event. So every time a user clicks a link some code will get executed. I used the live() function instead of the more common click() event handler because live() ties all future instances of an element to the function instead of just the ones initially in the DOM. This means I can happily insert new &#8216;a&#8217; elements knowing that they’ll still respond in the same way. Here’s the click event code (this should also go in the $(document).ready so that it&#8217;s ready when the page loads):</p>
<pre class='brush: js'>

$('a.internal').live('click',function() {
var post_url = $(this).attr('href');
//alert(post_url);
$.historyLoad(post_url);
return false;
});
</pre>
<p>You can see that I&#8217;m binding this function to the click events for each &#8216;a.internal&#8217; element. I&#8217;ve given each internal link this class so that I can differentiate between internal and external links. If all links were treated the same, I&#8217;d get google.com loading inside my homepage. I extract the ‘href’ part of the link so that I know where the link is pointing. This is then assigned to the variable ‘post_url’. Then I call the historyLoad() method. This tells the jQuery plugin I just set up to add a new page to the browser history. It does this by adding a hash key to the end of the url. For example www.mysite.com/page1 would become www.mysite.com/page1#page2 in the address bar, and my application would then go about rendering the page2 on my page to reflect the change. The ‘return false;’ line is important, as this stops the browser executing it’s normal event handling for the element. If I didn’t include this line, all would be lost, as the browser would merrily redirect us to page2.html (thinking it was a regular link) and page1 would be lost to the wind.</p>
<h2>Step 3: Rendering the page</h2>
<p>Once historyLoad() has done it’s job and added a page to the browser history, it will then follow a callback function that we defined earlier with historyInit(). The callback function renderPage() is going to run the AJAX request and insert the new data into my page. The code for this is as follows (this can go anywhere in your javascript code):</p>
<pre class='brush: js'>

function ajaxRender(post_url) {
$('body').css('cursor','wait'); // changes the cursor to a wait symbol
if($.browser.msie) { // if the browser is Internet Explorer
// jquery's $.load() function does't work when hash include special characters like åäö.
post_url = encodeURIComponent(post_url); // removes special characters
}
if (post_url) { // checks that a URL is present
$.ajax({ // start the AJAX request
type: 'POST', // I'm sending it via POST, you can use GET if you're feeling dangerous
url: post_url, // the URL we are retrieving
data: null, // in this case we are not sending any data
success: function(data) { // execute the below if the AJAX goes according to plan
$('#page_content').html(data); // put the data retrieved from the AJAX request into the div container
$('body').css('cursor','default'); // put the cursor back to normal
},
error: function (XMLHttpRequest, textStatus, errorThrown) { // execute this if it all goes tits up
$('body').css('cursor','default');
alert(textStatus + errorThrown);
return false;
}
});
} else { // if there is no post_url, i.e. it's the home page
$('body').css('cursor','default'); // put the cursor back to normal
}
};
</pre>
<p>This function executes the AJAX request and puts the data it retrieves into the #page_content div.</p>
<p>Once you&#8217;ve got these three components in your code you should be OK.</p>
<p>Note: If you’re just loading stuff from a file and not sending data it would be a better idea to use jQuery’s load() method.</p>
<p>Feel free to comment if there&#8217;s a bit you don&#8217;t understand or are having trouble with.</p>
<p>Edit: I just discovered that this process is called &#8216;deep linking&#8217;. Sounds like a bit of a serious term, but it is much shorter than &#8216;the restoration of conventional page navigation to an AJAX application&#8217;. Had I known this before I wrote this post I probably would&#8217;ve looked into using the <a href="http://www.asual.com/jquery/address/">jQuery Address deep linking plugin</a> instead. But my method worked fine for me . . .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricfairground.com/2009/10/01/restoring-conventional-page-navigation-to-your-javascript-application-with-jquery-history-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Query&#8217;s Maphilight Plugin Tutorial &#8211; Create Cool jQuery Image Map Hover Effects</title>
		<link>http://www.electricfairground.com/2009/08/08/image-map-rollover-effects-using-jquerys-maphilight-plugin/</link>
		<comments>http://www.electricfairground.com/2009/08/08/image-map-rollover-effects-using-jquerys-maphilight-plugin/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 12:15:49 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<guid isPermaLink="false">http://www.electricfairground.com/?p=47</guid>
		<description><![CDATA[Update: you can see the finished version of my map here. So I want to make a big map of europe that hilights the different countries when you move your mouse over them. Initially I thought this would be really &#8230;<p class="read-more"><a href="http://www.electricfairground.com/2009/08/08/image-map-rollover-effects-using-jquerys-maphilight-plugin/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff6600;">Update: you can see the finished version of my map <a href="http://www.workingineuropeandasia.com/?u=1c6a6f942368d690c3cba37b7b0eef6a" rel="nofollow">here</a>.</span></p>
<p>So I want to make a big map of europe that hilights the different countries when you move your mouse over them. Initially I thought this would be really easy using a bit of CSS and :hover . . . . no dice. But to my surprise I found out that it&#8217;s possible to use an ordinary HTML image map to define some pretty complex shapes, and let&#8217;s face it, shapes don&#8217;t get much more complex than this.</p>
<p>OK, so it&#8217;s possible to create clickable areas in HTML using an image map, but how do I add rollover effects to this? CSS didn&#8217;t seem to work so my next port of call was the wonderful jQuery. I found a plugin call <a href="http://plugins.jquery.com/project/maphilight" rel="nofollow">mapHilight</a> that takes an HTML image map, and adds some javascript hilighting wizardry to it. You can see a really cool example using a <a href="http://davidlynch.org/js/maphilight/docs/demo_usa.html" rel="nofollow">map of the states</a>, this is almost exactly what I want but for Europe. I&#8217;m going to try and record everything I do, in the hope that someone else might find this useful, so here goes.</p>
<p><span id="more-47"></span></p>
<h2>Step 1: Your image</h2>
<p>First of all, you need to prepare the source image. In this example I&#8217;m going to be using a map of europe (see below).</p>
<p><a href="http://www.electricfairground.com/img/maphilight_post/grey_map.png"><img class="alignnone" title="Grey map of Europe" src="http://www.electricfairground.com/img/maphilight_post/grey_map.png" alt="" width="340" height="351" /></a></p>
<h2>Step 2: HTML Image Maps</h2>
<p>Now that I have my image ready, I need to work out how to get the computer to recognise the individual areas. For my map each country is separated from other bordering countries by a white line, your image might not be so defined, in which case you should probably open the image up in Photoshop or something and separate the sections to make it easier.</p>
<p>I did a bit of research on Google and came across something quite interesting. Built into HTML there are &lt;map&gt; and &lt;shape&gt; tags. These are used to define image maps like the one I&#8217;m trying to make. An example of an HTML image map is this:</p>
<pre class="brush: js">
<map name="testMap">
<area id="box" shape="polygon" coords="20,20,106,20,106,106,20,106" href="http://www.stackoverflow.com" />
<area id="triangle" shape="polygon" coords="216,50,339,50,277,156" href="http://www.google.com" />
<area id="bordertriangle" shape="polygon" coords="460,0,574,0,460,220" href="http://www.cnn.com" />
<area id="pentagon" shape="polygon" coords="704,65,769,115,744,196,665,196,640,115" href="http://slashdot.org" />
</map>
</pre>
<p>Here you can see four areas within a map. In this example each area is set as shape=&#8217;polygon&#8217;. This is because these shapes are complex and can&#8217;t be defined in simpler terms. However, if your image map is not so complicated, you could try using shape=&#8217;rect&#8217; or shape=&#8217;circle&#8217;.</p>
<ul>
<li><a href="http://www.javascriptkit.com/howto/imagemap.shtml" rel="nofollow">More information on Creating HTML Image Maps</a></li>
</ul>
<p>OK, so I know that the shape of each country on my map can probably be defined as a list of points (like a join-the-dots puzzle). I&#8217;m not sure exactly what the numbers will mean, but I guess they&#8217;re just coordinates on a fictional grid slapped on top of my image.</p>
<p>Next question: How do I get these coordinates for my own image?</p>
<h2>Step 3: Download Inkscape</h2>
<p>Well after a bit more digging I found an App called <a href="http://www.inkscape.org/index.php?lang=en">Inkscape</a>.</p>
<p><a href="http://www.inkscape.org/download/?lang=en" rel="nofollow">Download Inkscape (it&#8217;s free)</a></p>
<p>I think you can probably use some other apps too, like Adobe&#8217;s Illustrator or something else, but I don&#8217;t have the kind of money to splash out on such overpriced tripe, so I&#8217;ll be using Inkscape.</p>
<p>Right, while that&#8217;s downloading I&#8217;ll explain why I think Inkscape will do the job. To be honest I don&#8217;t really know that much about inkscape. What I do know is that you can open up any image you like and trace the edges. You can then save the image again (in a different format) and this will contain this list of coordinates that I&#8217;m after. Hopefully.</p>
<h2>Step 4: Path Detection in Inkscape</h2>
<p><code>Once you've finished downloading Inkscape you'll need to open it up. Then select File&gt;Open and select the image you are working on.</code></p>
<p>Now here&#8217;s where it gets a bit more complicated. Inkscape is very good at detecting edges, but I found it needed a helping hand to make sure it knew that all of these countries were separate blobs, and not just one big blob. The first time I tried edge detection I managed to get a big polygon, but it was so big that it took up most of mainland Europe. What I&#8217;d recommend you do is do a bit of experimentation to see how well Inkscape finds the borders in your image.</p>
<p>To give it a go, click on your image (so that there are black resizing dots around it), then select Path&gt;Trace Bitmap. In the box that pops up, you can either select &#8216;Edge Detection&#8217; or &#8216;Color Quantization&#8217;. As far as I can tell, you should use the first if there are very definitive edges already in the image and the second if the areas you&#8217;re trying to separate are different colours. I first tried &#8216;Edge Detection&#8217; and this wasn&#8217;t really working for me. So I went back to Photoshop and coloured all my countries in different colours, opened Inkscape back up and selected &#8216;Color Quantization&#8217; and it worked much better. Once you&#8217;ve selected your choice click &#8216;Update&#8217; to get a preview of what it will look like and then &#8216;OK&#8217; to start the magic.</p>
<p>Now if it&#8217;s worked, you should see a black line around each of the areas in your image. Inkscape should turn your image into several different shapes all with a black outline. If this doesn&#8217;t happen, or you get shapes in the wrong places, you&#8217;ll have to undo the path detection and try again. Once you&#8217;re happy you can move onto the next step.</p>
<h2>Step 5: HTML Polygonization</h2>
<p>In Inkscape, save the image as a .svg file. This is the format we&#8217;re going to use to extract the path information for our HTML polygon shapes. Open up your SVG file in your favourite text editor and scroll down until you find a list of numbers a bit like this one:</p>
<p>d=&#8221;M 662.5,1204 C 634.39954,1200.1136 558.02119,1154.3401 .. . .. .</p>
<p>Believe it or not, this is your image map. Unfortunately this data is in a format that isn&#8217;t very useful to us. Not only are the shape coordinates shrouded in a mysterious M and C characters, but they are also using lots of decimal places which HTML can&#8217;t understand. To sort this jumble of nonsense I decided to write a bit of Javascript. I call this my <a href="http://www.electricfairground.com/polygonator/index.html">Polygonator</a>. Go there and enter in the numbers and text within the &#8220;s just after d=&#8221;. So your bit of text will start M 662 . . .etc and should end with a single z. Then click &#8216;Process&#8217; and you should be given some HTML code. Hooray!</p>
<p>A word of warning: depending on how acurate you want your area to be you may need to simplify your path a bit. If your SVG files contains millions of coordinates and you want something much simpler, then you can open it back up in Inkscape and select Path&gt;Simplify. Then repeat this step.</p>
<h2>Step 6: Add Your Image Area</h2>
<p>Copy all of this HTML and paste it between the &lt;map&gt; &lt;/map&gt; tags in your webpage. You should now have something that looks a bit like:</p>
<pre class="brush: html">
<map name="testMap">
<area id="shape1" shape="poly" coords="20,20,106,20,106,106,20,106" href="http://www.electricfairground.com" />
</map>
</pre>
<p>If you have more than one line in your SVG file starting with d=&#8221; then you&#8217;ll need to process each of these and convert them one at a time. Just repeat steps 5 and 6 for each of them and you should be OK.</p>
<h2>Step 7: jQuery and mapHilight</h2>
<p>Now we need to tie up the loose ends and get to the jQuery bit. If you haven&#8217;t already included jQuery at the top of your page then put this in your &lt;head&gt; section:</p>
<pre class="brush: php">
&lt; ?= javascript_include_tag('jquery-1.3.2.min.js'); ?&gt;</pre>
<p>Now we need to add the MapHilight jQuery plugin. I don&#8217;t really understand what this plugin does, but it seemed to do wonders for my map, so you should give it a go too.  Download the <a href="http://plugins.jquery.com/project/maphilight">mapHilight plugin</a> and then include it just after you included jQuery.</p>
<pre class="brush: php">
&lt; ?= javascript_include_tag('jquery.maphilight.min.js'); ?&gt;

<script type="text/javascript"><!--mce:0--></script></pre>
<p>The second bit of script just initiates the plugin. It looks for an image with class=&#8217;map&#8217;, so if you&#8217;re using the same code make sure your image has this class. For example:</p>
<pre class="brush: html">
<img usemap="#testMap" src="images/map/grey_map.png" alt="Click on a country to see its profile" /></pre>
<p>You&#8217;ll see my image also has usemap=&#8221;#testMap&#8221;. This is the bit that links the image to the &lt;map&gt;. So make sure you include the name of your map in this bit.</p>
<h2>Good Work Team</h2>
<p>Finished! Now when you look at your page you should see that different sections of your map light up when you move your mouse over them. Let me know if you have any problems and I&#8217;ll do my best to suggest something.</p>
<div style="width: 460px; height: 100%; top: 0px; right: 0px; padding-left: 0px; position: fixed; background-color: white; z-index: 1000; display: none;">
<div style="border: 0px none; top: 1px; width: 100%; height: 42px; position: absolute;">
<form>
<div style="position: absolute; left: 2px; right: 0px;">
<input id="LIU_txt" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; left: 0px; right: 240px; font-size: 14px ! important; height: 17px ! important; line-height: 50px; display: block;" />
<select id="LIU_sel" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; width: 100px; right: 138px; font-size: 14px ! important; height: 17px;">
<option style="border: 0pt none; width: 30%; height: 19px;">Wikipedia</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Wictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Chambers (UK)</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google images</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google define</option>
<option style="border: 0pt none; width: 30%; height: 19px;">The Free Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Join example</option>
<option style="border: 0pt none; width: 30%; height: 19px;">WordNet</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Urban Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Answers.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">rhymezone.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Merriam-Webster</option>
</select>
<input id="LIU_search" style="border: 1px solid black; padding: 0pt; position: absolute; width: 68px; right: 68px; font-size: 14px ! important; height: 19px;" type="submit" value="Search" /><button id="LIU_prev" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 46px; height: 19px;">&lt;</button><button id="LIU_next" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 24px; height: 19px;">&gt;</button><button id="LIU_mode" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 2px; height: 19px;">0</button></div>
<div style="position: absolute; left: 2px; right: 0px; top: 22px;"><button id="LIU_0" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">w</button><button id="LIU_1" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">v</button><button id="LIU_2" style="border-bottom: 1px solid white; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">c</button><button id="LIU_3" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">i</button><button id="LIU_4" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">d</button><button id="LIU_5" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">f</button><button id="LIU_6" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">j</button><button id="LIU_7" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">o</button><button id="LIU_8" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">g</button><button id="LIU_9" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">u</button><button id="LIU_10" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">a</button><button id="LIU_11" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">r</button><button id="LIU_12" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">m</button></div>
</form>
</div>
</div>
<div style="width: 460px; height: 100%; top: 0px; right: 0px; padding-left: 0px; position: fixed; background-color: white; z-index: 1000; display: none;">
<div style="border: 0px none; top: 1px; width: 100%; height: 42px; position: absolute;">
<form>
<div style="position: absolute; left: 2px; right: 0px;">
<input id="LIU_txt" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; left: 0px; right: 240px; font-size: 14px ! important; height: 17px ! important; line-height: 50px; display: block;" />
<select id="LIU_sel" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; width: 100px; right: 138px; font-size: 14px ! important; height: 17px;">
<option style="border: 0pt none; width: 30%; height: 19px;">Wikipedia</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Wictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Chambers (UK)</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google images</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google define</option>
<option style="border: 0pt none; width: 30%; height: 19px;">The Free Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Join example</option>
<option style="border: 0pt none; width: 30%; height: 19px;">WordNet</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Urban Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Answers.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">rhymezone.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Merriam-Webster</option>
</select>
<input id="LIU_search" style="border: 1px solid black; padding: 0pt; position: absolute; width: 68px; right: 68px; font-size: 14px ! important; height: 19px;" type="submit" value="Search" /><button id="LIU_prev" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 46px; height: 19px;">&lt;</button><button id="LIU_next" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 24px; height: 19px;">&gt;</button><button id="LIU_mode" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 2px; height: 19px;">0</button></div>
<div style="position: absolute; left: 2px; right: 0px; top: 22px;"><button id="LIU_0" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">w</button><button id="LIU_1" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">v</button><button id="LIU_2" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">c</button><button id="LIU_3" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">i</button><button id="LIU_4" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">d</button><button id="LIU_5" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">f</button><button id="LIU_6" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">j</button><button id="LIU_7" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">o</button><button id="LIU_8" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">g</button><button id="LIU_9" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">u</button><button id="LIU_10" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">a</button><button id="LIU_11" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">r</button><button id="LIU_12" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">m</button></div>
</form>
</div>
</div>
<div style="width: 460px; height: 100%; top: 0px; right: 0px; padding-left: 0px; position: fixed; background-color: white; z-index: 1000; display: none;">
<div style="border: 0px none; top: 1px; width: 100%; height: 42px; position: absolute;">
<form>
<div style="position: absolute; left: 2px; right: 0px;">
<input id="LIU_txt" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; left: 0px; right: 240px; font-size: 14px ! important; height: 17px ! important; line-height: 50px; display: block;" />
<select id="LIU_sel" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; width: 100px; right: 138px; font-size: 14px ! important; height: 17px;">
<option style="border: 0pt none; width: 30%; height: 19px;">Wikipedia</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Wictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Chambers (UK)</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google images</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google define</option>
<option style="border: 0pt none; width: 30%; height: 19px;">The Free Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Join example</option>
<option style="border: 0pt none; width: 30%; height: 19px;">WordNet</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Urban Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Answers.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">rhymezone.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Merriam-Webster</option>
</select>
<input id="LIU_search" style="border: 1px solid black; padding: 0pt; position: absolute; width: 68px; right: 68px; font-size: 14px ! important; height: 19px;" type="submit" value="Search" /><button id="LIU_prev" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 46px; height: 19px;">&lt;</button><button id="LIU_next" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 24px; height: 19px;">&gt;</button><button id="LIU_mode" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 2px; height: 19px;">0</button></div>
<div style="position: absolute; left: 2px; right: 0px; top: 22px;"><button id="LIU_0" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">w</button><button id="LIU_1" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">v</button><button id="LIU_2" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">c</button><button id="LIU_3" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">i</button><button id="LIU_4" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">d</button><button id="LIU_5" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">f</button><button id="LIU_6" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">j</button><button id="LIU_7" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">o</button><button id="LIU_8" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">g</button><button id="LIU_9" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">u</button><button id="LIU_10" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">a</button><button id="LIU_11" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">r</button><button id="LIU_12" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">m</button></div>
</form>
</div>
</div>
<div style="width: 460px; height: 100%; top: 0px; right: 0px; padding-left: 0px; position: fixed; background-color: white; z-index: 1000; display: none;">
<div style="border: 0px none; top: 1px; width: 100%; height: 42px; position: absolute;">
<form>
<div style="position: absolute; left: 2px; right: 0px;">
<input id="LIU_txt" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; left: 0px; right: 240px; font-size: 14px ! important; height: 17px ! important; line-height: 50px; display: block;" />
<select id="LIU_sel" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; width: 100px; right: 138px; font-size: 14px ! important; height: 17px;">
<option style="border: 0pt none; width: 30%; height: 19px;">Wikipedia</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Wictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Chambers (UK)</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google images</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google define</option>
<option style="border: 0pt none; width: 30%; height: 19px;">The Free Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Join example</option>
<option style="border: 0pt none; width: 30%; height: 19px;">WordNet</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Urban Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Answers.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">rhymezone.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Merriam-Webster</option>
</select>
<input id="LIU_search" style="border: 1px solid black; padding: 0pt; position: absolute; width: 68px; right: 68px; font-size: 14px ! important; height: 19px;" type="submit" value="Search" /><button id="LIU_prev" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 46px; height: 19px;">&lt;</button><button id="LIU_next" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 24px; height: 19px;">&gt;</button><button id="LIU_mode" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 2px; height: 19px;">0</button></div>
<div style="position: absolute; left: 2px; right: 0px; top: 22px;"><button id="LIU_0" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">w</button><button id="LIU_1" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">v</button><button id="LIU_2" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">c</button><button id="LIU_3" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">i</button><button id="LIU_4" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">d</button><button id="LIU_5" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">f</button><button id="LIU_6" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">j</button><button id="LIU_7" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">o</button><button id="LIU_8" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">g</button><button id="LIU_9" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">u</button><button id="LIU_10" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">a</button><button id="LIU_11" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">r</button><button id="LIU_12" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">m</button></div>
</form>
</div>
</div>
<p><a href="http://mxbikeparts.com/category/motocross-boots/">motocross boots</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricfairground.com/2009/08/08/image-map-rollover-effects-using-jquerys-maphilight-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JQuery Image Dimensions</title>
		<link>http://www.electricfairground.com/2009/06/30/jquery-image-dimensions/</link>
		<comments>http://www.electricfairground.com/2009/06/30/jquery-image-dimensions/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 14:34:31 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<guid isPermaLink="false">http://www.electricfairground.com/?p=28</guid>
		<description><![CDATA[Simple code to grab the dimensions of any image on your page. Here&#8217;s an example: Tell JQuery to find out how big this image is by using: var width = $("#my_image").width(); var height = $("#my_image").height();]]></description>
			<content:encoded><![CDATA[<p>Simple code to grab the dimensions of any image on your page. Here&#8217;s an example:</p>
<pre class='brush: html'>
<img id="my_image" src="image.png" alt="My Image" />
</pre>
<p>Tell JQuery to find out how big this image is by using:</p>
<pre class='brush: js'>
var width = $("#my_image").width();
var height = $("#my_image").height();
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.electricfairground.com/2009/06/30/jquery-image-dimensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>spEak You&#8217;re bRanes &#8211; the pile of steaming faeces that is the BBC&#8217;s &#8220;Have Your Say&#8221; site</title>
		<link>http://www.electricfairground.com/2009/03/25/speak-youre-branes-the-pile-of-steaming-faeces-that-is-the-bbcs-have-your-say-site/</link>
		<comments>http://www.electricfairground.com/2009/03/25/speak-youre-branes-the-pile-of-steaming-faeces-that-is-the-bbcs-have-your-say-site/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 16:46:16 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<guid isPermaLink="false">http://www.electricfairground.com/?p=25</guid>
		<description><![CDATA[Working for the BBC&#8217;s &#8220;Have Your Say&#8221; site is a position to aspire to. On the one hand, you are trying to stop the plague of racist, vacant armchair generals spreading their hatewords. And on the other hand, you are &#8230;<p class="read-more"><a href="http://www.electricfairground.com/2009/03/25/speak-youre-branes-the-pile-of-steaming-faeces-that-is-the-bbcs-have-your-say-site/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Working for the BBC&#8217;s &#8220;Have Your Say&#8221; site is a position to aspire to. On the one hand, you are trying to stop the plague of racist, vacant armchair generals spreading their hatewords. And on the other hand, you are trying to promote the independent, unbisased journalism that has made the BBC a household name worldwide.</p>
<p>At least, that&#8217;s what you&#8217;d think.</p>
<p>Two examples of how this <strong>is not the case</strong> come in the forms of <a title="ifyoulikeitsomuchwhydontyougolivethere.com" href="http://http://ifyoulikeitsomuchwhydontyougolivethere.com/" target="_blank">ifyoulikeitsomuchwhydontyougolivethere.com</a> &#8211; &#8220;A collection of ignorance, narcissism, stupidity, hypocrisy and bad grammar&#8221; that are comments taken from the site, and <a title="newssniffer.co.uk" href="http://www.newssniffer.co.uk/" target="_blank">NewSniffer</a><span style="text-decoration: underline;"><span style="color: #800080;">.co.uk</span></span> &#8211; a site that dsiaplys comments that have been censored, and tracks changes to BBC articles. The &#8216;Recommended Revisions&#8217; section shows that many article updates have a different agenda to the average typo corrections you&#8217;d expect.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricfairground.com/2009/03/25/speak-youre-branes-the-pile-of-steaming-faeces-that-is-the-bbcs-have-your-say-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

