<?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>dtsn</title>
	<atom:link href="http://dtsn.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://dtsn.co.uk</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 21 Feb 2010 13:51:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mouse Pointer Tracker</title>
		<link>http://dtsn.co.uk/2010/01/26/mouse-pointer-tracker/</link>
		<comments>http://dtsn.co.uk/2010/01/26/mouse-pointer-tracker/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 12:00:00 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Mouse]]></category>
		<category><![CDATA[Mouse Tracker]]></category>
		<category><![CDATA[Pointer]]></category>
		<category><![CDATA[Tracker]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=759</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>Anatoly Zenkov (flickr) has created a great little Java app which will record your mouse pointer movements over your screen&#8230;</p>


No related posts.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F01%2F26%2Fmouse-pointer-tracker%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F01%2F26%2Fmouse-pointer-tracker%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=Mouse,Mouse+Tracker,Pointer,Tracker,UI" height="61" width="51" /><br />
			</a>
		</div>
<p>Anatoly Zenkov (<a href="http://www.flickr.com/photos/anatoliy_zenkov/">flickr</a>) has created a great little Java app which will record your mouse pointer movements over your screen and then save the image of all your mouse movements. You get some great screenshots (have a look at <a href="http://www.flickr.com/photos/anatoliy_zenkov/4271592658/">some of the comments</a> on the flickr post).</p>
<p>You can download the little Java App from here <a href="http://dl.dropbox.com/u/684632/mousepath.exe.zip">PC</a>, <a href="http://dl.dropbox.com/u/684632/mousepath.jar">Mac</a></p>
<p>Here are some of my screenshots below. The best thing about this app is that it makes a great tool for UI testing. You can see where a user clicks and their mouse paths really easily!</p>
<p><a href="http://dtsn.co.uk/wp-uploads/2010/01/mousepath16-04-16.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="mousePath-16_04_16" src="http://dtsn.co.uk/wp-uploads/2010/01/mousepath16-04-16-thumb.png" border="0" alt="mousePath-16_04_16" width="480" height="200" /></a></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2010/01/26/mouse-pointer-tracker/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Free Rocket Vector</title>
		<link>http://dtsn.co.uk/2010/01/19/free-rocket-vector/</link>
		<comments>http://dtsn.co.uk/2010/01/19/free-rocket-vector/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 11:00:09 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Freebie]]></category>
		<category><![CDATA[Free]]></category>
		<category><![CDATA[Rocket]]></category>
		<category><![CDATA[Vector]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=750</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p align="left">I got a lot of feedback from my post last week about optimizing JavaScript, everyone seemed to love the image&#8230;</p>


No related posts.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F01%2F19%2Ffree-rocket-vector%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F01%2F19%2Ffree-rocket-vector%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=Free,Rocket,Vector" height="61" width="51" /><br />
			</a>
		</div>
<p align="left">I got a lot of feedback from my post last week about <a href="http://dtsn.co.uk/2010/01/12/optimizing-javascript/">optimizing JavaScript</a>, everyone seemed to love the image of the rocket I had. So I decided to give it away free, it was one of those drawings I did years ago.</p>
<p align="left"><a href="http://dtsn.co.uk/wp-uploads/2010/01/Rocket.zip"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Untitled-1" border="0" alt="Untitled-1" src="http://dtsn.co.uk/wp-uploads/2010/01/untitled1-thumb.png" width="480" height="200" /></a></p>
<p align="left">You can <a href="http://dtsn.co.uk/wp-uploads/2010/01/Rocket.zip">download it now</a>, its available in .ai, .svg and a .png file. </p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2010/01/19/free-rocket-vector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimizing JavaScript</title>
		<link>http://dtsn.co.uk/2010/01/12/optimizing-javascript/</link>
		<comments>http://dtsn.co.uk/2010/01/12/optimizing-javascript/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 13:23:05 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=628</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>JavaScript is in the middle of a massive comeback and developers are abusing it. JavaScript addons and widgets are becoming&#8230;</p>


Related posts:<ol><li><a href='http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/' rel='bookmark' title='Permanent Link: JavaScript Halloween Effects'>JavaScript Halloween Effects</a></li>
<li><a href='http://dtsn.co.uk/2008/03/14/scriptaculous-scrollto-tutorial/' rel='bookmark' title='Permanent Link: Scriptaculous ScrollTo'>Scriptaculous ScrollTo</a></li>
<li><a href='http://dtsn.co.uk/2009/12/10/javascript-checkuncheck-checkboxes/' rel='bookmark' title='Permanent Link: JavaScript Check/Uncheck Checkboxes'>JavaScript Check/Uncheck Checkboxes</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F01%2F12%2Foptimizing-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F01%2F12%2Foptimizing-javascript%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=JavaScript,Optimization,Performance" height="61" width="51" /><br />
			</a>
		</div>
<p>JavaScript is in the middle of a massive comeback and developers are abusing it. JavaScript addons and widgets are becoming are the norm for large sites and are so easy to install, in large numbers and quantities. For example <a href="http://mashable.com">Mashable</a> loads nearly a mega byte in JavaScript files. In this article I will go through some tips to help you optimize your JavaScript and reduce both the load on your servers and make your pages respond faster.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="js" border="0" alt="js" src="http://dtsn.co.uk/wp-uploads/2010/01/js-thumb.png" width="480" height="200" /></p>
<h2>Cut code</h2>
<p>The first and biggest thing you should do in optimizing your JavaScript is to cut down on the size, cut out functions that don’t do a lot and try and reduce the size of your file. This goes along side with the question <strong>do you need a framework</strong>? Think it through, is your site big enough to warrant loading a full framework (typically in excess of 3000 lines), if you just want to do some very simple functions write them in JavaScript without a framework.</p>
<p>If you really need to load a framework use the ones available on the <a href="http://code.google.com/apis/ajaxlibs/documentation/">Google AJAX libraries API</a>, most frameworks are available. These are just the frameworks hosted on Google, they work of the principle that if one website uses these files then the user will still have the files in the browser cache and won’t need load them again.</p>
<h3>Minimize </h3>
<p>Run your code through a JavaScript minimiser, this will shrink all the files to be really small there are a number of popular ones available (this is also applicable for CSS):</p>
<ul>
<li>Bundle Fu &#8211; <a title="http://code.google.com/p/bundle-fu/" href="http://code.google.com/p/bundle-fu/">http://code.google.com/p/bundle-fu/</a> </li>
<li>Pack:tag &#8211; <a title="http://sourceforge.net/projects/packtag/" href="http://sourceforge.net/projects/packtag/">http://sourceforge.net/projects/packtag/</a> </li>
<li>JSMIN &#8211; <a title="http://www.crockford.com/javascript/jsmin.html" href="http://www.crockford.com/javascript/jsmin.html">http://www.crockford.com/javascript/jsmin.html</a> </li>
<li>YUI Compressor &#8211; <a title="http://yuilibrary.com/downloads/#yuicompressor" href="http://yuilibrary.com/downloads/#yuicompressor">http://yuilibrary.com/downloads/#yuicompressor</a> </li>
</ul>
<h2>Expires headers</h2>
<p>Set your expires headers, this should be standard for all your static content like CSS and Images as well. A browser may need to make many requests to your server in order to get all the content, by using an expires header you make those components cacheable for a set period of time, therefore the browser will need to make less HTTP requests. For a more detailed explanation, as well other components which need improving reading the <a href="http://developer.yahoo.com/performance/rules.html#expires">Yahoo Developer Network Guide on optimisation</a>.</p>
<h2>Loading Scripts Asynchronously</h2>
<p>Browsers are only single threaded, this means that it can only really load one thing at a time. However there are ways around this, and ways you can load multiple files without locking up the browser. Give Steve Souders articles on <a href="http://www.stevesouders.com/blog/2009/04/27/loading-scripts-without-blocking/">Loading Scripts without Blocking</a> if you are interested in implementing this. I am currently working on a prototype based class to do this which will be published on this blog in the coming months.</p>
<h2>Defer JavaScript Loading</h2>
<p>Steve Souders talks about deferring JavaScript loading in his series about <a href="http://www.stevesouders.com/blog/2009/12/07/downloading-javascript-as-strings/">high performance websites</a>. It’s quite a simple idea really, don’t load up the JavaScript until you require it. Therefore if your JavaScript is not needed on page load this should be deferred to be loaded up later.</p>
<h2>Evaluate</h2>
<p>Make sure you evaluate your performance when trying to optimize JavaScript. I personally love the Firefox plugin <a href="http://getfirebug.com">FireBug</a>, and it’s plugin <a href="http://developer.yahoo.com/yslow/">YSlow</a>. However there are lots of other methods and tools you can use to evaluate you performance, the best by far is the firebug profiler. <a href="http://michaelsync.net/2007/09/10/firebug-tutorial-logging-profiling-and-commandline-part-ii">Micheal Sync</a> has a fantastic tutorial on the FireBug profiler which is well worth a read.</p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/' rel='bookmark' title='Permanent Link: JavaScript Halloween Effects'>JavaScript Halloween Effects</a></li>
<li><a href='http://dtsn.co.uk/2008/03/14/scriptaculous-scrollto-tutorial/' rel='bookmark' title='Permanent Link: Scriptaculous ScrollTo'>Scriptaculous ScrollTo</a></li>
<li><a href='http://dtsn.co.uk/2009/12/10/javascript-checkuncheck-checkboxes/' rel='bookmark' title='Permanent Link: JavaScript Check/Uncheck Checkboxes'>JavaScript Check/Uncheck Checkboxes</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2010/01/12/optimizing-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bouncing JavaScript Tutorial</title>
		<link>http://dtsn.co.uk/2010/01/07/bouncing-javascript-tutorial/</link>
		<comments>http://dtsn.co.uk/2010/01/07/bouncing-javascript-tutorial/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 11:00:38 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Scriptaculous]]></category>
		<category><![CDATA[Bounce]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=692</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p><strong>Original Source</strong>: http://giancarlo.dimassa.net</p>
<p>There have been many examples of bouncing effects in scriptaculous but this one has to be one of&#8230;</p>


Related posts:<ol><li><a href='http://dtsn.co.uk/2008/03/14/scriptaculous-scrollto-tutorial/' rel='bookmark' title='Permanent Link: Scriptaculous ScrollTo'>Scriptaculous ScrollTo</a></li>
<li><a href='http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/' rel='bookmark' title='Permanent Link: JavaScript Halloween Effects'>JavaScript Halloween Effects</a></li>
<li><a href='http://dtsn.co.uk/2009/12/10/javascript-checkuncheck-checkboxes/' rel='bookmark' title='Permanent Link: JavaScript Check/Uncheck Checkboxes'>JavaScript Check/Uncheck Checkboxes</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F01%2F07%2Fbouncing-javascript-tutorial%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F01%2F07%2Fbouncing-javascript-tutorial%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=Bounce,JavaScript,Prototype,Scriptaculous" height="61" width="51" /><br />
			</a>
		</div>
<p><strong>Original Source</strong>: <a href="http://giancarlo.dimassa.net/2007/07/11/elastic-and-bouncing-transitions-in-scriptaculous/">http://giancarlo.dimassa.net</a></p>
<p>There have been many examples of bouncing effects in <a href="http://script.aculo.us/">scriptaculous</a> but this one has to be one of the most realistic. It uses the equations developed by <a href="http://www.robertpenner.com/">Robert Penner</a> to accurately represent a bounce, and it does look cool.</p>
<h2>What you need</h2>
<p>As with most of my tutorials this is based on <a href="http://script.aculo.us/">scriptaculous</a> and <a href="http://www.prototypejs.org/">prototype</a>, but the equations could easily be porter to other animation frameworks.</p>
<h2>The code</h2>
<p>This is really simple, basically what we are going to be doing is to add a new transitional effect to scriptaculous. To do this we just extend the Effect class.</p>
<p><strong>Add this to your own JavaScript file instead of scriptaculous, so you don’t loose it when you update.</strong></p>
<pre class="js" name="code">/*Based on Easing Equations v2.0
(c) 2003 Robert Penner, all rights reserved.
This work is subject to the terms in http://www.robertpenner.com/easing_terms_of_use.html

Adapted for Scriptaculous by Ken Snyder (kendsnyder ~at~ gmail ~dot~ com) June 2006
*/

Effect.Transitions.Bounce = function (pos) {
    if (pos &lt; 0.36363636363636365) {
        return 7.5625 * pos * pos;
    } else if (pos &lt; 0.7272727272727273) {
        return 7.5625 * (pos -= 0.5454545454545454) * pos + 0.75;
    } else if (pos &lt; 0.9090909090909091) {
        return 7.5625 * (pos -= 0.8181818181818182) * pos + 0.9375;
    } else {
        return 7.5625 * (pos -= 0.9545454545454546) * pos + 0.984375;
    }
}</pre>
<h2>Use it</h2>
<p>You can use this effect as a transition type with lots of effects.</p>
<pre>new Effect.BlindDown(div, {
    duration: 0.5,
    transition: Effect.Transitions.Bounce
});</pre>
<p>Check out <a href="http://giancarlo.dimassa.net/2007/07/11/elastic-and-bouncing-transitions-in-scriptaculous/">Ken Snyder’s</a> blog for more transitional effects.</p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2008/03/14/scriptaculous-scrollto-tutorial/' rel='bookmark' title='Permanent Link: Scriptaculous ScrollTo'>Scriptaculous ScrollTo</a></li>
<li><a href='http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/' rel='bookmark' title='Permanent Link: JavaScript Halloween Effects'>JavaScript Halloween Effects</a></li>
<li><a href='http://dtsn.co.uk/2009/12/10/javascript-checkuncheck-checkboxes/' rel='bookmark' title='Permanent Link: JavaScript Check/Uncheck Checkboxes'>JavaScript Check/Uncheck Checkboxes</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2010/01/07/bouncing-javascript-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Tips</title>
		<link>http://dtsn.co.uk/2010/01/05/css-tips/</link>
		<comments>http://dtsn.co.uk/2010/01/05/css-tips/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 12:01:00 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[browser support]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[grids]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=694</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>I thought I’d share some of my CSS habits/top tips, some of my habits may be more controversial than others,&#8230;</p>


Related posts:<ol><li><a href='http://dtsn.co.uk/2009/12/15/css3-selectors-last-child/' rel='bookmark' title='Permanent Link: CSS3 Selectors :last-child'>CSS3 Selectors :last-child</a></li>
<li><a href='http://dtsn.co.uk/2008/10/15/super-css-the-power-of-the-selector/' rel='bookmark' title='Permanent Link: Super CSS, the power of the selector'>Super CSS, the power of the selector</a></li>
<li><a href='http://dtsn.co.uk/2009/12/17/tips-on-christmas-wrapping/' rel='bookmark' title='Permanent Link: Tips on Christmas Wrapping'>Tips on Christmas Wrapping</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F01%2F05%2Fcss-tips%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fdtsn.co.uk%2F2010%2F01%2F05%2Fcss-tips%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=browser+support,CSS,grids,HTML,Tips,validation" height="61" width="51" /><br />
			</a>
		</div>
<p>I thought I’d share some of my CSS habits/top tips, some of my habits may be more controversial than others, but it’s always good to share.</p>
<p><span id="more-694"></span><br />
<h2>Looking Pretty</h2>
<p>Always remember to format your CSS nicely. Most CSS coders are designers, and love to make things look pretty, which also makes the CSS easier to read.</p>
<p><strong>One line CSS declarations</strong> &#8211; I always put my entire declaration onto one line, it makes declarations a lot easier to find, and even better if you keep your properties in alphabetical order.</p>
<p><strong>Use Shorthand</strong> &#8211; My rule is that if you are setting any more than one property use shorthand, here’s a clue to what I mean:</p>
<pre class="css" name="code">/* You could right */
.dummy {
   margin-top: 10px;
   margin-bottom: 10px;
}
/* but what's the point when this exists */
.dummy { margin: 10px 0px; }
/* or even */
.dummy { background: url('myimage.jpg') blue no-repeat left top; }</pre>
<p><strong>Shortcuts</strong> &#8211; When your CSS file becomes massive instead of splitting the file up into manageable chucks, which causes unnecessary hits on your server, just split the file with comments. If you use a wild card character like @ you can easily search for specific sections.</p>
<h2>Make things easy</h2>
<p>CSS is tricky, so use tools to make it easier.</p>
<p><strong>Grids</strong> &#8211; While I am still debating whether grids are appropriate for smaller scale projects, if you use a wide variety of different layout, or are having trouble with the compatibility of your current layout take a look at CSS grids, there are loads available such as <a href="http://code.google.com/p/blueprintcss/">Blueprint</a> and the <a href="http://developer.yahoo.com/yui/grids/">Yahoo UI</a>.</p>
<p><strong>Check</strong> &#8211; Always validate your code, i personally run mine through <a href="http://www.microsoft.com/expression/">Microsoft Expression Web</a> which checks for bugs, you can also use the <a href="http://jigsaw.w3.org/css-validator/">W3C Validation Checker</a>.</p>
<p><a href="http://jigsaw.w3.org/css-validator/"><img title="opps" alt="" src="http://www.dtsn.co.uk/wp-content/uploads/2008/05/opps1.jpg" /></a></p>
<p><em>W3C CSS Validation Checker</em></p>
<p><strong>Avoid using too many selectors</strong> &#8211; Just specify the minimum number of selectors needed. A td always appears within a tr which always appears within a table. If you find yourself nesting your selectors like the example below, you are probably being too verbose.</p>
<pre class="css" name="code">table tr td {...}
/* is the same as */
td {...}</pre>
<h2>Points, they all add up</h2>
<p>Don’t forget that all the different selectors have a different weighting (also known as <strong>specificity</strong>), and the ordering of your selectors will affect which one has president.</p>
<blockquote>
<p>A selector&#8217;s specificity is calculated as follows:</p>
<ul>
<li>count 1 if the declaration is from is a &#8217;style&#8217; attribute rather than a rule with a selector, 0 otherwise (= a) (In HTML, values of an element&#8217;s &quot;style&quot; attribute are style sheet rules. These rules have no selectors, so a=1, b=0, c=0, and d=0.) </li>
<li>count the number of ID attributes in the selector (= b) </li>
<li>count the number of other attributes and pseudo-classes in the selector (= c) </li>
<li>count the number of element names and pseudo-elements in the selector (= d) </li>
</ul>
<p>The specificity is based only on the form of the selector. In particular, a selector of the form &quot;[id=p33]&quot; is counted as an attribute selector (a=0, b=0, c=1, d=0), even if the id attribute is defined as an &quot;ID&quot; in the source document&#8217;s DTD. </p>
<p>Concatenating the four numbers a-b-c-d (in a number system with a large base) gives the specificity. </p>
</blockquote>
<p>- Taken from the <a href="http://www.w3.org/TR/CSS21/cascade.html">W3C specification</a></p>
<h2>Browser Support</h2>
<p>Avoid supporting anything but the most recent browsers. I don’t know anyone who use IE5 anymore do you? Also stop uses hacks for IE6, some careful rethinking and workarounds could be explored before resulting to using hacks. With the less hacks the more you can avoid having a separate style sheet for each browser. If you look at <a href="http://wikipedia.com">Wikipedia</a> in source view you will see they have a separate style sheet for IE5, IE5.5, IE6, IE7.</p>
<h2>Set things up</h2>
<p>Spending a couple of minutes at the start of the project setting up all your colours and classes could save you hours in the long run.</p>
<p><strong>Utilities</strong> &#8211; Build a set of CSS utilities which you could use everywhere. E.g.</p>
<pre class="css" name="code">.left { float:left; }
.right { float: right; }
.overflow { overflow: hidden; }
.clear { clear: both; }
.pad { padding: 10px; }</pre>
<p><strong>Define your colours</strong> &#8211; Define your commonly used colours at the start of the stylesheet then you will always know where they are for easy reference.</p>
<h2>Keep Things Simple</h2>
<p>Always go back and try and make your code simpler, and remember to comment everything. This make it easier to find changes and edit them. There is no need to get any more complicated than you need to be. For some more tips check out <a href="http://smashingmagazine.com">Smashing Magazine</a> who have a great article on <a href="http://www.smashingmagazine.com/2007/05/10/70-expert-ideas-for-better-css-coding/">CSS ideas</a>.</p>
<h2>More Resources</h2>
<p><a title="http://www.w3.org/Style/Examples/007/" href="http://www.w3.org/Style/Examples/007/">W3C Tricks &amp; Tips</a></p>
<p><a title="http://www.hongkiat.com/blog/20-useful-css-tips-for-beginners/" href="http://www.hongkiat.com/blog/20-useful-css-tips-for-beginners/">20 Useful CSS Tips for Beginners</a></p>
<p><a title="http://snook.ca/archives/html_and_css/top_css_tips/" href="http://snook.ca/archives/html_and_css/top_css_tips/">Top CSS Tips (snooka)</a></p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2009/12/15/css3-selectors-last-child/' rel='bookmark' title='Permanent Link: CSS3 Selectors :last-child'>CSS3 Selectors :last-child</a></li>
<li><a href='http://dtsn.co.uk/2008/10/15/super-css-the-power-of-the-selector/' rel='bookmark' title='Permanent Link: Super CSS, the power of the selector'>Super CSS, the power of the selector</a></li>
<li><a href='http://dtsn.co.uk/2009/12/17/tips-on-christmas-wrapping/' rel='bookmark' title='Permanent Link: Tips on Christmas Wrapping'>Tips on Christmas Wrapping</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2010/01/05/css-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips on Christmas Wrapping</title>
		<link>http://dtsn.co.uk/2009/12/17/tips-on-christmas-wrapping/</link>
		<comments>http://dtsn.co.uk/2009/12/17/tips-on-christmas-wrapping/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 09:00:00 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Christmas]]></category>
		<category><![CDATA[Gift]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Ribbon]]></category>
		<category><![CDATA[Wrapping]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=721</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>It’s coming up to Christmas again and you should be thinking about wrapping up all those presents that you have&#8230;</p>


Related posts:<ol><li><a href='http://dtsn.co.uk/2009/02/11/tweetmeme-revamp/' rel='bookmark' title='Permanent Link: Tweetmeme Revamp'>Tweetmeme Revamp</a></li>
<li><a href='http://dtsn.co.uk/2008/08/02/five-fantastic-colour-scheme-generators-design/' rel='bookmark' title='Permanent Link: Five Fantastic Colour Scheme Generators'>Five Fantastic Colour Scheme Generators</a></li>
<li><a href='http://dtsn.co.uk/2010/01/05/css-tips/' rel='bookmark' title='Permanent Link: CSS Tips'>CSS Tips</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F17%2Ftips-on-christmas-wrapping%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F17%2Ftips-on-christmas-wrapping%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=Christmas,Design,Gift,Inspiration,Ribbon,Wrapping" height="61" width="51" /><br />
			</a>
		</div>
<p>It’s coming up to Christmas again and you should be thinking about wrapping up all those presents that you have brought this year. In this handy blog post I will give you some of my tips and how to wrap the perfect present.</p>
<h2>Choose A Colour Scheme</h2>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Wrapping Paper" border="0" alt="Wrapping Paper" src="http://dtsn.co.uk/wp-uploads/2009/12/img-2734.jpg" width="480" height="320" /> </p>
<p>That’s right, why shouldn’t wrapping be like anything else you design? Wrapping should be part of the present you are giving, it would mean a lot more to someone if they know you have taken the time and care to wrap your present properly and professionally. </p>
<p>You ideally want a nice colour scheme of about 2 to 3 colours, try not to over do it. I find the most simple colour schemes are the best, this year I have gone for a red and white colour scheme, as shown above. I would recommend staying with traditional Christmas colours, like white, silver, gold and green. However you might want to try different colour schemes, but you would be hard pushed to get a different colour wrapping paper at this time of the year.</p>
<h3>Paper</h3>
<p>There are 100’s if not 1000’s of different paper designs available at this time of year, I would say that it is always best to go for a simple plain colour. It gives a much more professional look, ends up being a lot cheaper and won’t have to match the pattern on the join between the two ends. </p>
<p>Always try to go for a high quality paper, the basic rule is the ticker the paper. Particular types of paper like foil are a lot harder to crease, so my advice would be to try and avoid them as much as possible.</p>
<h3>Know Your Ribbon</h3>
<h3><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IMG_2736" border="0" alt="IMG_2736" src="http://dtsn.co.uk/wp-uploads/2009/12/img-2736.jpg" width="480" height="278" /> </h3>
<p>There are many different types of ribbon you can get, here are the 3 basic types:</p>
<ol>
<li>Standard material based ribbon, like the red polka dot one above. This gives your presents a very elegant solution, however it is expensive and not very good for tieing bows. </li>
<li>Wired material based ribbon, this is like the material one, but has wires running either side meaning it will keep it’s shape when formed into bows. </li>
<li>Paper based ribbon, can be brought in cheap vast quantities. However this ribbon can be tacky if overused. </li>
</ol>
<p>The most important thing to remember is to buy your ribbon <strong>early</strong> and buy lots of it. I brought this ribbon at the beginning of November, by the start of December it was all sold out. The especially happens for ribbon in the popular Christmas colours.</p>
<p>Remember after all the present giving has happened to go round and retrieve your ribbon before it goes into the bin, you never know you might reuse it next year.</p>
<h3>Tags</h3>
<h3><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IMG_2740" border="0" alt="IMG_2740" src="http://dtsn.co.uk/wp-uploads/2009/12/img-2740.jpg" width="480" height="320" /> </h3>
<p>Tags are quite easy to get right, especially with services like <a href="http://moo.com">Moo</a> which is a business card service, however they allow you to print any pattern onto the front of a card. You can get 100 for £13, that’s 13p a card, cheaper than most high streets.</p>
<p>If you can’t find a tag that matches you can use another method of cutting pieces of card out and sticking some of the large off cuts of wrapping on it. It’s best to use double sided sticky tape for this, glue sometimes leaks through (depending on how thick your paper is).</p>
<h2>Learn How To Wrap</h2>
<p>Lots of people think they know how to wrap a present but you should really learn and practice before starting on the mammoth number of presents you have to wrap. There are lots of online guides, I mostly wrap in the style laid out in the tutorial on <a href="http://www.ehow.com/how_8019_wrap-gift.html">eHow</a>. Remember to make the wrapping easier for yourself buy putting things in boxes, it is a lot easier to wrap a box then a circle.</p>
<h2>Share</h2>
<p>Share your tips and tricks for wrapping in the comments below.</p>
<h2>Wrapping Inspiration</h2>
<ol>
<li><a title="http://www.noupe.com/inspiration/impressive-gift-package-design-inspiration-for-christmas.html" href="http://www.noupe.com/inspiration/impressive-gift-package-design-inspiration-for-christmas.html">Impressive Gift Package Design Inspiration For Christmas</a> </li>
<li><a href="http://www.channel4.com/4homes/christmas/christmas-wrapping-ideas-08-10-17_p_1.html">Christmas Wrapping Ideas – Channel 4</a> </li>
</ol>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2009/02/11/tweetmeme-revamp/' rel='bookmark' title='Permanent Link: Tweetmeme Revamp'>Tweetmeme Revamp</a></li>
<li><a href='http://dtsn.co.uk/2008/08/02/five-fantastic-colour-scheme-generators-design/' rel='bookmark' title='Permanent Link: Five Fantastic Colour Scheme Generators'>Five Fantastic Colour Scheme Generators</a></li>
<li><a href='http://dtsn.co.uk/2010/01/05/css-tips/' rel='bookmark' title='Permanent Link: CSS Tips'>CSS Tips</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/12/17/tips-on-christmas-wrapping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 Selectors :last-child</title>
		<link>http://dtsn.co.uk/2009/12/15/css3-selectors-last-child/</link>
		<comments>http://dtsn.co.uk/2009/12/15/css3-selectors-last-child/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 12:00:13 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[last-child]]></category>
		<category><![CDATA[Selectors]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=696</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>Of all the CSS3 selectors the structural pseudo-classes have to be my favourite. In particular I love :last-child selector, the&#8230;</p>


Related posts:<ol><li><a href='http://dtsn.co.uk/2008/10/15/super-css-the-power-of-the-selector/' rel='bookmark' title='Permanent Link: Super CSS, the power of the selector'>Super CSS, the power of the selector</a></li>
<li><a href='http://dtsn.co.uk/2008/04/11/highlighting-forms/' rel='bookmark' title='Permanent Link: Highlighting Forms'>Highlighting Forms</a></li>
<li><a href='http://dtsn.co.uk/2010/01/05/css-tips/' rel='bookmark' title='Permanent Link: CSS Tips'>CSS Tips</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F15%2Fcss3-selectors-last-child%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F15%2Fcss3-selectors-last-child%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=CSS,CSS3,last-child,Selectors" height="61" width="51" /><br />
			</a>
		</div>
<p>Of all the <a href="http://web.archive.org/web/20080503011837/http://www.w3.org/TR/css3-selectors/">CSS3 selectors</a> the structural pseudo-classes have to be my favourite. In particular I love :last-child selector, the :last-child CSS selector is incredibly powerful especially when positioning elements in a row, I am currently finding it incredibly useful when doing menus. Instead of providing a last class on the very last element in the row, you can now use pure CSS to achieve the same effect.</p>
<h2>CSS 2.1</h2>
<pre class="css" name="code">/*Each Element*
.image { margin-right: 5px; height: 20px; width: 20px; float:left; background-color: red; }
/* remove the margin on the last element so it lines up
.image.last { margin-right: 0px; }</pre>
<h2>CSS 3</h2>
<pre class="css" name="code">/* parent of the image element */
.parent div:last-child { margin-right: 0px; }</pre>
<h2>The Downside</h2>
<p>Unfortunately the bad aspect of this selector is that it does not fail gracefully. Meaning that a user in a none CSS3 compliant browser, <strong>(IE)</strong>, it would fail horribly, this means that everything will be out of line.</p>
<h2>Example</h2>
<p>If you look at this in anything but a browser which supports CSS3 the last element will be on the next line.</p>
<style type="text/css">
.example { margin-right: 6px; height: 20px; width: 75px; float:left; background-color: #317b9e; }
.example-block { overflow: hidden; margin-bottom: 10px; }
.example-block div:last-child { margin-right: 0px; }</style>
<div class="example-block">
<div class="example"></div>
<div class="example"></div>
<div class="example"></div>
<div class="example"></div>
<div class="example"></div>
<div class="example"></div>
</div>
<h2>More Resources</h2>
<ol>
<li><a href="http://www.w3.org/TR/css3-selectors/">W3C Selectors Level 3</a></li>
<li><a href="http://www.css3.info/modules/selector-compat/">CSS3 Compatibility Table</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/cc351024%28VS.85%29.aspx">MSDN Compatibility Table (tells you what works in IE8)</a></li>
<li><a href="http://www.smashingmagazine.com/2009/06/15/take-your-design-to-the-next-level-with-css3/">Take Your Design To The Next Level With CSS3</a></li>
</ol>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2008/10/15/super-css-the-power-of-the-selector/' rel='bookmark' title='Permanent Link: Super CSS, the power of the selector'>Super CSS, the power of the selector</a></li>
<li><a href='http://dtsn.co.uk/2008/04/11/highlighting-forms/' rel='bookmark' title='Permanent Link: Highlighting Forms'>Highlighting Forms</a></li>
<li><a href='http://dtsn.co.uk/2010/01/05/css-tips/' rel='bookmark' title='Permanent Link: CSS Tips'>CSS Tips</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/12/15/css3-selectors-last-child/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaScript Check/Uncheck Checkboxes</title>
		<link>http://dtsn.co.uk/2009/12/10/javascript-checkuncheck-checkboxes/</link>
		<comments>http://dtsn.co.uk/2009/12/10/javascript-checkuncheck-checkboxes/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 12:00:00 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Check All]]></category>
		<category><![CDATA[Checkbox]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Uncheck All]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=685</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>This tutorial is a really simple one and is only a one liner in prototype (slight more in regular JavaScript).&#8230;</p>


Related posts:<ol><li><a href='http://dtsn.co.uk/2008/04/11/highlighting-forms/' rel='bookmark' title='Permanent Link: Highlighting Forms'>Highlighting Forms</a></li>
<li><a href='http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/' rel='bookmark' title='Permanent Link: JavaScript Halloween Effects'>JavaScript Halloween Effects</a></li>
<li><a href='http://dtsn.co.uk/2010/01/07/bouncing-javascript-tutorial/' rel='bookmark' title='Permanent Link: Bouncing JavaScript Tutorial'>Bouncing JavaScript Tutorial</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F10%2Fjavascript-checkuncheck-checkboxes%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F10%2Fjavascript-checkuncheck-checkboxes%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=Check+All,Checkbox,Form,HTML,JavaScript,Prototype,Uncheck+All" height="61" width="51" /><br />
			</a>
		</div>
<p>This tutorial is a really simple one and is only a one liner in prototype (slight more in regular JavaScript). It will check all the checkboxes on a page, and a function to uncheck all checkboxes quite handy really especially if you are dealing with long lists.</p>
<h2>Check All</h2>
<pre class="js" name="code">$$('input[type=&quot;checkbox&quot;]').invoke('writeAttribute', 'checked', 'checked');</pre>
<p>What we are doing here is selecting all the inputs of type checkbox and enumerating over them writing a check attribute to each one.</p>
<h2>Uncheck All</h2>
<pre class="js" name="code">$$('input[type=&quot;checkbox&quot;]').invoke('removeAttribute', 'checked');</pre>
<p>As you can guess this just the opposite way round.</p>
<h2>JavaScript</h2>
<p>You can do the same basic principle without a framework:</p>
<pre class="js" name="code">// check all
var inputs = document.getElementsByTagName('input');
for (var i = 0; i &lt; inputs.length; i++) {
	if (inputs[i].type == 'checkbox') {
		inputs[i].checked = true;
	}
}

// uncheck all
var inputs = document.getElementsByTagName('input');
for (var i = 0; i &lt; inputs.length; i++) {
	if (inputs[i].type == 'checkbox') {
		inputs[i].checked = false
	}
}</pre>
<p>That&#8217;s it there isn&#8217;t really much to it, but I thought it was worth sharing.</p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2008/04/11/highlighting-forms/' rel='bookmark' title='Permanent Link: Highlighting Forms'>Highlighting Forms</a></li>
<li><a href='http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/' rel='bookmark' title='Permanent Link: JavaScript Halloween Effects'>JavaScript Halloween Effects</a></li>
<li><a href='http://dtsn.co.uk/2010/01/07/bouncing-javascript-tutorial/' rel='bookmark' title='Permanent Link: Bouncing JavaScript Tutorial'>Bouncing JavaScript Tutorial</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/12/10/javascript-checkuncheck-checkboxes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSON(P) Stacking</title>
		<link>http://dtsn.co.uk/2009/12/06/jsonp-stacking/</link>
		<comments>http://dtsn.co.uk/2009/12/06/jsonp-stacking/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 13:30:50 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Website Hanging]]></category>
		<category><![CDATA[Widgets]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=677</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>JSONP was proposed as grabbing data from external domains avoiding the cross script scripting limitations (see this Ajaxian article for&#8230;</p>


Related posts:<ol><li><a href='http://dtsn.co.uk/2009/11/26/javascript-weather/' rel='bookmark' title='Permanent Link: JavaScript Weather'>JavaScript Weather</a></li>
<li><a href='http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/' rel='bookmark' title='Permanent Link: JavaScript Halloween Effects'>JavaScript Halloween Effects</a></li>
<li><a href='http://dtsn.co.uk/2008/03/14/scriptaculous-scrollto-tutorial/' rel='bookmark' title='Permanent Link: Scriptaculous ScrollTo'>Scriptaculous ScrollTo</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F06%2Fjsonp-stacking%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F06%2Fjsonp-stacking%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=JavaScript,JSON,Website+Hanging,Widgets" height="61" width="51" /><br />
			</a>
		</div>
<p>JSONP was proposed as grabbing data from external domains avoiding the cross script scripting limitations (see this <a href="http://ajaxian.com/archives/jsonp-json-with-padding">Ajaxian article</a> for more information). It requires a call to an external API where you specificy the a callback function, you do this through the use of script tag. For example:</p>
<pre class="html" name="code">&lt;script type=&quot;text/javascript&quot; src=&quot;http://yourdomain.com/api?callback=myfunction&quot;&gt;&lt;/script&gt;</pre>
<p>When the script tag has been loaded your function would be called with the JSON data, like so.</p>
<pre class="js" name="code">myfunction(‘some JSON data’);</pre>
<p>However you become reliant on that external service to always be available, if for any reason that service goes down you wouldn’t get any data and your page would be likely to hang.</p>
<p><strong>Therefore I propose a system of JSONP stacking, quite simply you stack up your JSON requests if you don’t receive a response in a set time it will stop the request.</strong></p>
<p>This can be easily achieved by having the following function:</p>
<pre class="js" name="code">// callback function
var _c = false;
// success flag
var _s = false;

function JSONPStacking(url, callback) {
	// create the element
	var script = document.createElement('script');
	// set the source
	script.src = url + '&amp;callback=callback';
	// render the element
	document.appendChild(script);
	// start the counter, this one last for 5 seconds
	setTimeout(function() {
		if (!_s) {
			// remove the element
			document.body.removeChild(script);
		}
	}, 5000);
}

function callback(data) {
	// say the data has been received
	_s = true;
	// call the callback with the data
	_c(data);
}</pre>
<p>Basically what we are doing here is to create a normal JSONP request by creating a script tag and loading it into the body. However we are overriding the standard callback function with our own one, <em>callback. </em>When the request succeeds this will call that function with the data and in turn we call our success function. If 5 seconds have past the timeout will trigger, see if the success flag has been set if not it will remove the element from the DOM thereby stopping the request.</p>
<p>That&#8217;s it, it is a really simple principle but will hopefully stop your site from hanging on long request, such as for the Twitter widget. It will also make your widgets that you build a lot more stable and won&#8217;t overload your site.</p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2009/11/26/javascript-weather/' rel='bookmark' title='Permanent Link: JavaScript Weather'>JavaScript Weather</a></li>
<li><a href='http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/' rel='bookmark' title='Permanent Link: JavaScript Halloween Effects'>JavaScript Halloween Effects</a></li>
<li><a href='http://dtsn.co.uk/2008/03/14/scriptaculous-scrollto-tutorial/' rel='bookmark' title='Permanent Link: Scriptaculous ScrollTo'>Scriptaculous ScrollTo</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/12/06/jsonp-stacking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How Would I Improve Twitter’s UI</title>
		<link>http://dtsn.co.uk/2009/12/03/how-would-i-improve-twitters-ui/</link>
		<comments>http://dtsn.co.uk/2009/12/03/how-would-i-improve-twitters-ui/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 10:00:00 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=633</guid>
		<description><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<br />
				<br />
			
		</div>
<p>Twitter is quickly gathering pace and is fast becoming one of the most popular social networks. I have been using&#8230;</p>


Related posts:<ol><li><a href='http://dtsn.co.uk/2009/12/01/better_twitter/' rel='bookmark' title='Permanent Link: Better Twitter'>Better Twitter</a></li>
<li><a href='http://dtsn.co.uk/2009/03/28/what%e2%80%99s-wrong-with-tweetdeck/' rel='bookmark' title='Permanent Link: What’s wrong with Tweetdeck'>What’s wrong with Tweetdeck</a></li>
<li><a href='http://dtsn.co.uk/2009/09/22/twitter-t-shirt-version-2/' rel='bookmark' title='Permanent Link: Twitter T-shirt Version 2'>Twitter T-shirt Version 2</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin: 3px 0px 0px 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F03%2Fhow-would-i-improve-twitters-ui%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fdtsn.co.uk%2F2009%2F12%2F03%2Fhow-would-i-improve-twitters-ui%2F&amp;source=dtsn&amp;style=normal&amp;service=is.gd&amp;hashtags=Twitter,UI,UX" height="61" width="51" /><br />
			</a>
		</div>
<p>Twitter is quickly gathering pace and is fast becoming one of the most popular social networks. I have been using Twitter for nearly 2 years, mostly through their use of 3rd part applications like <a href="http://www.tweetdeck.com">TweetDeck</a> or <a href="http://www.atebits.com/tweetie-mac/">Tweetie</a>. I thought to myself why do I, and many other ‘power’ Twitter users not use the web interface? So here are some of my suggestions on how I would improve the Twitter UI.</p>
<p><a href="http://dtsn.co.uk/wp-uploads/2009/11/twitter-home.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="twitter_-_home" border="0" alt="twitter_-_home" src="http://dtsn.co.uk/wp-uploads/2009/11/twitter-home-thumb.png" width="480" height="479" /></a></p>
<p><em>Twitter home page design at the time of writing the article, including some reference points.</em></p>
<p>I will be focusing on a number of parts of the home page, the main ‘tweet box’, the implementation of the ‘lists’ area, how the data is presented and the integration with search. This is not meant as a critique of Twitter, but more as some helpful suggestions on usability.</p>
<h2>Tweet Box</h2>
<p>For lack of a better word, the tweebox is the textarea located at the top of the twitter homepage. I would really love to see it improved in a number of really simple ways:</p>
<ul>
<li>The ability to press enter to submit a tweet. Tweets aren’t multi lined and there is nothing else to do so why not make enter submit the form instead of press the button. Twitter has this problem in a number of other area’s as well, OAuth screen! </li>
<li>Autocomplete the usernames in the textbox.</li>
<li>Auto shortening. Twitter has already partly done this for really long links, but it would be nice if you could have the option to do it on the shorter links as well. </li>
</ul>
<h2>Page improvements</h2>
<p>The live update of tweets, you know the little yellow box which tells you how many are waiting, is a fantastic addition. But I think they are missing the key points, why wouldn’t you show the tweet? I just find it really annoying.</p>
<p>The page is currently geared up to just tweeting. Users probably use the Twitter interface more to manage their tweets and accounts, maybe the front page should be geared in that direction.</p>
<h2>Other</h2>
<p>The lists nor retweets seem to be fully integrated into the UI they just appear to be something strapped onto the edge. It would be great if you could, for example, have tabs across your timeline which listed your most popular lists.</p>
<p>It would be great to hear your thoughts on how you would make twitter better, you never know maybe Twitter is reading this.</p>
<h2>Better Twitter</h2>
<p>Hopefully my recently released Firefox plugin <a href="http://dtsn.co.uk/2009/12/01/better_twitter/">Better Twitter</a> will solve most of these issues.</p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2009/12/01/better_twitter/' rel='bookmark' title='Permanent Link: Better Twitter'>Better Twitter</a></li>
<li><a href='http://dtsn.co.uk/2009/03/28/what%e2%80%99s-wrong-with-tweetdeck/' rel='bookmark' title='Permanent Link: What’s wrong with Tweetdeck'>What’s wrong with Tweetdeck</a></li>
<li><a href='http://dtsn.co.uk/2009/09/22/twitter-t-shirt-version-2/' rel='bookmark' title='Permanent Link: Twitter T-shirt Version 2'>Twitter T-shirt Version 2</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/12/03/how-would-i-improve-twitters-ui/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
