<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.friendlybit.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0"><channel><title>Friendly Bit - Web Development Blog</title> <link>http://friendlybit.com</link> <description>You have found Friendly Bit, a web development blog. I focus on client side technologies like CSS, HTML and Javascript. I try to post once per week (average).</description> <lastBuildDate>Tue, 31 Aug 2010 22:04:05 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="friendlybit" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://friendlybit.com/feed/" /><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.bloglines.com/sub/http://friendlybit.com/feed/" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffriendlybit.com%2Ffeed%2F" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffriendlybit.com%2Ffeed%2F" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><item><title>Lazy Loading Asyncronous Javascript</title><link>http://friendlybit.com/js/lazy-loading-asyncronous-javascript/</link> <comments>http://friendlybit.com/js/lazy-loading-asyncronous-javascript/#comments</comments> <pubDate>Fri, 07 May 2010 22:15:06 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[JS]]></category><guid isPermaLink="false">http://friendlybit.com/?p=613</guid> <description><![CDATA[Like many of you might know, I&#8217;m working on a site called Kundo with a couple of friends. It&#8217;s kinda like a Swedish version of Getsatisfaction, which means we have a javascript snippet that people add to their site to get feedback functionality. Cut-and-paste instead of writing the code yourself. Simple. The problem is, how [...]]]></description> <content:encoded><![CDATA[<p>Like many of you might know, I&#8217;m working on a site called <a
href="http://kundo.se">Kundo</a> with a couple of friends. It&#8217;s kinda like a Swedish version of <a
href="http://getsatisfaction.com/">Getsatisfaction</a>, which means we have a javascript snippet that people add to their site to get feedback functionality. Cut-and-paste instead of writing the code yourself. Simple.</p><p>The problem is, how do you load an external javascript with minimal impact on your customer&#8217;s sites? Here are my requirements:</p><ol><li><strong>Small</strong>. I don&#8217;t want a big mess for them to include on their sites. 10-15 lines, tops.</li><li><strong>Stand-alone</strong>. The environment is unknown, so we can&#8217;t rely on any external dependencies, like javascript libraries.</li><li><strong>Cross-browser</strong>. I have no idea what browsers me customer&#8217;s customers have, so I can&#8217;t do anything modern or fancy that isn&#8217;t backwards compatible. I assume at least IE6 and up though.</li><li><strong>Asynchronous download</strong>. The download of my script should not block the download of any script on their sites.</li><li><strong>Lazy Loading</strong>. If my site is temporarily slow, I don&#8217;t want to block the onload event from triggering until after our site responds.</li><li><strong>Preserve events</strong>. Any events used should not override any events on the customer&#8217;s site. Minimal impact, like I said.</li><li><strong>Don&#8217;t pollute namespace</strong>. Global variables should be avoided, since they could conflict with existing javascript.</li></ol><p>Note: I did not make all of this up myself. Lots of people did, I&#8217;m just writing it down for you. Thanks: <a
href="http://lillbra.se">Jonatan</a>, <a
href="http://stevenbenner.com/">Steven</a>, <a
href="http://fleecelabs.se/">Peter</a>, and <a
href="http://hanssonlarsson.se/">Linus</a>.</p><h2>Script tag</h2><pre class="incorrect"><code >&lt;script src="http://yourdomain.com/script.js"&gt;&lt;/script&gt;</code></pre><p>While being the stand-alone, cross-browser, and the shortest piece of code possible; it doesn&#8217;t download asynchronously and doesn&#8217;t lazy load. <strong>Fail</strong>.</p><div
style="overflow: auto;"><img
class="alignnone size-full wp-image-619" title="Firebug screenshoot with script tag" src="http://friendlybit.com/wp-content/uploads/2010/05/script.png" alt="" width="725" height="70" /></div><p><em><strong>Screenshot from Firebug&#8217;s net console: </strong>The script (set to load in 2 seconds) blocks the download of the big image (added after the above script tag, and used throughout this article as a test). Onload event (the red line) triggers after 2.46 seconds.</em></p><h2>Async pattern (A script tag written with javascript)</h2><p><a
href="http://stevesouders.com">Steve Souders</a>, the web performance guru, has compiled a decision tree over <a
href="http://stevesouders.com/efws/images/0405-load-scripts-decision-tree-04.gif">different ways to achieve non-blocking downloads</a>. Have a look at that graph.</p><p>Since we&#8217;re on a different domain, and only have one script (order doesn&#8217;t matter), the solution is given: We should create a script tag with inline javascript, and append it to the document. Voila! Non-blocking download!</p><pre><code >(function() {
    var s = document.createElement('script');
    s.type = 'text/javascript';
    s.async = true;
    s.src = 'http://yourdomain.com/script.js';
    var x = document.getElementsByTagName('script')[0];
    x.parentNode.insertBefore(s, x);
})();</code></pre><p><strong>Note</strong>: <code >async</code> is a <a
href="http://www.whatwg.org/specs/web-apps/current-work/#attr-script-async">HTML5 attribute</a>, doing exactly what we&#8217;re trying to simulate with our hack, so it&#8217;s added for good measure. Also, wrapping the code in an anonymous function prevents any variables to leak out to the rest of the document.</p><p>This is a pattern that is getting more and more popular nowadays, especially since <a
href="http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html">Google Analytics uses it</a>. But there&#8217;s an important distinction here: The above snipped <strong>blocks onload from triggering</strong> until the referenced script is fully loaded. <strong>Fail</strong>.</p><p><strong>Update 2010-09-01</strong>: <a
href="#comment-34047">Steve Souders</a> adds that the above is only true for Firefox, Chrome, and Safari, but not IE and Opera. So for a IE-only site, this might be the best method.</p><div
style="overflow: auto;"><img
class="alignnone size-full wp-image-617" title="Firefox screenshoot with the async pattern" src="http://friendlybit.com/wp-content/uploads/2010/05/asyncload.png" alt="" width="726" height="69" /></div><p><em><strong>Screenshot from Firebug&#8217;s net console: </strong>The script (set to load  in 2 seconds) downloads in parallell with the big image. Onload event (the red line) triggers after 2.02 seconds.</em></p><h2>Lazy load pattern (Async pattern triggered onload)</h2><p>So, how to you make sure you don&#8217;t block onload? Well, you wrap your code inside a function that&#8217;s called on load. When the onload event triggers, you know you haven&#8217;t blocked it.</p><pre><code >window.onload = function() {
    var s = document.createElement('script');
    s.type = 'text/javascript';
    s.async = true;
    s.src = 'http://yourdomain.com/script.js';
    var x = document.getElementsByTagName('script')[0];
    x.parentNode.insertBefore(s, x);
}</code></pre><p>This works, but it overrides the onload event of the site that uses the script. This could be OK in some cases, where you have control over the site referencing the script, but I need to cater for that. <strong>Fail</strong>.</p><h2>Unobtrusive lazy load pattern</h2><p>The logical solution to the above problem is to use an incarnation of addEvent. addEvent is simply a common name for an cross browser way to take the current function tied to onload, add it to a queue, add your function to the queue, and tie the queue to the onload event. So which version of addEvent should we use?</p><p>There&#8217;s been competitions for writing a <a
href="http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html">short and compact version of addEvent</a>, and the winner of that competition was John Resig, with this little beauty:</p><pre><code >function addEvent(obj, type, fn)  {
  if (obj.attachEvent) {
    obj['e'+type+fn] = fn;
    obj[type+fn] = function(){obj['e'+type+fn](window.event);}
    obj.attachEvent('on'+type, obj[type+fn]);
  } else
    obj.addEventListener(type, fn, false);
}</code></pre><p><strong>Note</strong>: This is unsafe code, since it relies on serializing a function to a string, something that <a
href="http://my.opera.com/hallvors/blog/2007/03/28/a-problem-with-john-resigs-addevent">Opera mobile browsers have disabled</a>.</p><p>Thing is, we don&#8217;t need all that generic event stuff, we&#8217;re only dealing with onload here. So if we first replace the type attribute with hardcoded &#8216;load&#8217;, replace obj with &#8216;window&#8217;, and remove the fix for making &#8216;this&#8217; work in IE, we&#8217;ve got four lines of code left. Let&#8217;s combine this with the above lazy load pattern:</p><pre><code >(function() {
    function async_load(){
        var s = document.createElement('script');
        s.type = 'text/javascript';
        s.async = true;
        s.src = 'http://yourdomain.com/script.js';
        var x = document.getElementsByTagName('script')[0];
        x.parentNode.insertBefore(s, x);
    }
    if (window.attachEvent)
        window.attachEvent('onload', async_load);
    else
        window.addEventListener('load', async_load, false);
})();</code></pre><p>This is exactly what we&#8217;re looking for here. <strong>Finally!</strong></p><div
style="overflow: auto;"><img
class="alignnone size-full wp-image-618" title="Firebug screenshoot with the lazy load pattern" src="http://friendlybit.com/wp-content/uploads/2010/05/lazyload.png" alt="" width="726" height="71" /></div><p><em><strong>Screenshot from Firebug&#8217;s net console: </strong>The script  (set to load  in 2 seconds) downloads after the onload event has triggered. Onload event (the red line) triggers after 0.41 seconds.</em></p><p>And that wraps up this article: Different tactics works for different scenarios, and only understanding them all makes you capable of picking the right one for your problem. As always, I&#8217;m waiting for your feedback in the comments. Thanks for reading!</p> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=3ef-cj8mdaE:PR6d_78n-TM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=3ef-cj8mdaE:PR6d_78n-TM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=3ef-cj8mdaE:PR6d_78n-TM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=3ef-cj8mdaE:PR6d_78n-TM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=3ef-cj8mdaE:PR6d_78n-TM:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/js/lazy-loading-asyncronous-javascript/feed/</wfw:commentRss> <slash:comments>66</slash:comments> </item> <item><title>My iPad – a short review</title><link>http://friendlybit.com/modern-web/my-ipad-a-short-review/</link> <comments>http://friendlybit.com/modern-web/my-ipad-a-short-review/#comments</comments> <pubDate>Sun, 25 Apr 2010 18:33:32 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[Devices]]></category> <category><![CDATA[Modern web]]></category><guid isPermaLink="false">http://friendlybit.com/?p=594</guid> <description><![CDATA[About two weeks ago, I got my hands on an iPad. For those of you who have been living under a rock for the last months, and iPad is something that looks like a big iPhone, but behaves much like a small laptop. Since people who just spent over $500 for a toy, are very [...]]]></description> <content:encoded><![CDATA[<p>About two weeks ago, I got my hands on an iPad. For those of you who have been living under a rock for the last months, and <a
href="http://www.apple.com/ipad/">iPad</a> is something that looks like a big iPhone, but behaves much like a small laptop.</p><p>Since people who just spent over $500 for a toy, are very subjective in their judging (buying something bad would make you look stupid!), you have to take this review for what it is: Me trying to justify buying an expensive toy. To help my mind balance things a bit, I&#8217;m going to talk about two good things, and two bad things about the iPad.</p><ul><li><a
href="#ipad_ui"><strong>Good</strong>: Looks, UI and surfing the web</a></li><li><a
href="#ipad_developer"><strong>Bad</strong>: A horrible Developer Platform</a></li><li><a
href="#ipad_games"><strong>Good</strong>: Games that use the touch interface</a></li><li><a
href="#ipad_itunes"><strong>Bad</strong>: Downloading apps through iTunes</a></li><li><strong><a
href="#ipad_summary">Summary</a></strong></li></ul><h2 id="ipad_ui">Good: Looks, UI and surfing the web</h2><div
id="attachment_597" class="wp-caption alignleft" style="width: 310px"><a
href="http://friendlybit.com/wp-content/uploads/2010/04/ipad_and_banana.jpg"><img
class="size-medium wp-image-597 " title="iPad and Banana" src="http://friendlybit.com/wp-content/uploads/2010/04/ipad_and_banana-300x225.jpg" alt="" width="300" height="225" /></a><p
class="wp-caption-text">An iPad, here shown next to a old banana for comparison. Click for bigger image.</p></div><p>The area where the iPad really shines is when it comes to the look and feel. It&#8217;s simply gorgeous, feels good in your hand, and makes all your friends instantly drool (like you expect them to). The screen is as sharp (or sharper) than a computer monitor, and its brightness could light up a dark room.</p><p>Working with it is just as pleasant. You click, swipe, pinch and type, like you&#8217;ve done nothing nothing else in your life. As someone who haven&#8217;t used an iPhone before, I&#8217;m impressed. Those that have, say that the iPad is even snappier than the iPhone. Some application are of course better fit for a touch interface than others. Google Maps is one of them, when a large display combined with panning and zooming makes the old arrow and zoom buttons on the traditional Google Maps interface feel like stone-age.</p><p>They keyboard surprised me by being even better than I expected. In landscape mode it&#8217;s almost as large as a laptop keyboard, and in some cases even faster than a traditional keyboard since you don&#8217;t have to push, just touch the buttons. The biggest keyboard problem though is of course that you usually only have one hand available. When you have two hands, it&#8217;s great.</p><p>Another area where the iPad really works is as <strong>a window to the web</strong>.  Safari comes pre-installed (Microsoft monopoly anyone?) but works like a  charm. Pages load quickly, and swiping to scroll and pinch to zoom  works just like it should.</p><p>Web standards are well supported, like  you expect from Safari. But some new problems emerge when looking at  HTML5 demos though:</p><ul><li>The Safari inside the iPad isn&#8217;t as performant as a desktop  browser. So there&#8217;s lots of lagging when trying to rotate things in  advanced ways.</li><li>Even though Apple has decided to ban Flash and pick a fight with  Adobe, many new apps are built to take advantage of the mouse moving  around. On the iPad, there&#8217;s no mouse pointer, so you have to simulate  one by touching the screen and moving the finger around.</li><li>Keyboard navigation is strange, because most of the time, you  don&#8217;t have a keyboard. The keyboard only shows up only when you focus a  text field, at other times, you&#8217;re lost.</li></ul><p>These things sound like annoyances, and they are, but they are also  quite minor. For all the surfing you usually do, the iPad works just  like it should.</p><h2 id="ipad_developer">Bad: A horrible Developer Platform</h2><p>As you&#8217;ve probably heard during the last few weeks, Apple have no clue whatsoever about how to cultivate a vibrant developer community. Let&#8217;s look at the facts:</p><ul><li>To distribute your app you need to join the iPhone Developer Program, that costs you $99-$299 per year.</li><li>To download the SDK you need to fill out a huge multi-step form (where almost all fields are required), and where you&#8217;re asked to give away lots of personal information.</li><li>When you &#8220;publish&#8221; your app it has to go through a manual approval process, which could take months if you are unlucky.</li><li>You need to approve to a ridiculous legal statement preventing you from using some programming languages, and making calls to some APIs.</li></ul><p>To quote:</p><blockquote><p>&#8220;3.3.1 — Applications may only use Documented APIs in the manner   prescribed by Apple and must not use or call any private APIs.   Applications must be originally written in Objective-C, C, C++, or   JavaScript as executed by the iPhone OS WebKit engine, and only   code written in C, C++, and Objective-C may compile and directly   link against the Documented APIs (e.g., Applications that link to   Documented APIs through an intermediary translation or   compatibility layer or tool are prohibited).&#8221;</p></blockquote><p>Needless to say,<strong> I&#8217;m never going to be develop anything for the Apple Platform</strong>. Apple and its developers is much like one big company (with strict rules). The only difference is that instead of a salary the developers get to pay to work for them. Good for Apple, horrible for developers.</p><h2 id="ipad_games">Good: Games that use the touch interface</h2><p>There are lots of good games that have started to take advantage of the big touch surface to make fun interaction styles possible.</p><ul><li><a
href="http://itunes.apple.com/us/app/tap-tap-radiation/id364160328?mt=8">Tap Tap Radiation</a> builds on you tapping the screen in pace with the music playing. The place to hit move around, just like the markers that indicate where to tap.</li><li><a
href="http://itunes.apple.com/us/app/id363998989?mt=8">Asphalt 5</a> is a beautiful racing game where you use the iPad as a steering wheel and tilt it back and fourth to steel. Since the accelerometer is so sensitive it works remarkably well.</li><li><a
href="http://itunes.apple.com/se/app/n-o-v-a-near-orbit-vanguard/id343596730?mt=8">N.O.V.A. &#8211; Near Orbit Vanguard Alliance</a> is a first person shooter that uses gestures to control who you shoot and how. Advanced gestures makes it possible to throw grenades that fly around corners, and targeting multiple enemies at once.</li></ul><p>Simply put, there are lots of fun games for the iPad, and the reason is experimentation with the touch interface. Combine this with several days of battery power, and you have many hours of fun ahead of you.</p><h2 id="ipad_itunes">Bad: Downloading apps through iTunes</h2><div
id="attachment_601" class="wp-caption alignleft" style="width: 162px"><a
href="http://friendlybit.com/wp-content/uploads/2010/04/ipad_closeup.jpg"><img
class="size-medium wp-image-601       " title="iPad closeup" src="http://friendlybit.com/wp-content/uploads/2010/04/ipad_closeup-225x300.jpg" alt="" width="152" height="203" /></a><p
class="wp-caption-text">A closer look at the iPad, still with the banana present. Click for bigger image.</p></div><p>Sadly, the only way to get apps legally into the iPad is through iTunes. Since my iPad was bought in the US, the App Store icon leads to a &#8220;Your request could not be completed&#8221; with no further info. So it seems that the App Store is only launched in the US. Silly me, that thought the web was an international thing.</p><p>Anyway, it is possible to get apps into the iPad without getting a fake american App Store account. You just use iTunes to download the apps to a desktop computer, and then sync your app to the iPad. It&#8217;s easy.</p><p>Well, strike that, using the iTunes store is not easy. Not being a previous iPhone using I had thought that downloading apps from iTunes was like shopping on Amazon. <strong>IT&#8217;S NOT EVEN CLOSE</strong>. This is how Apple built iTunes:</p><ol><li>Take one  fully functional e-commerce web site.</li><li>Make it slow so that people like me that surf on a 100 Mbit/s fibre connection have to wait several seconds after each click.</li><li>Make sure you can only access the store through a special downloadable app, that requires you sign several legal agreements, and leave away personal information, before you even bought anything.</li><li>Remove the possibility to sort through listings, remove any information what the list is currently sorted by, and hide options to only show apps for the device they know you just connected (the iPad).</li><li>Tada! You&#8217;ve built iTunes!</li></ol><p>Needless to say, each visit to the iTunes App Store is a bad experience, and no something you want to do often.</p><h2 id="ipad_summary">Summary</h2><p>Situations where I see myself using my iPad:</p><ul><li>In bed, watching public television through Svtplay. They have a great app, that is mainly adapted for iPhone, but scales up when used on a bigger screen.</li><li>Casually surfing the web from the couch. This includes checking my e-mail (which is IMAP over SSL, which works fine), checking my feeds through Google Reader, checking Facebook through the iPhone app (which can be pixel-doubled to fit the screen nicely), and twitter through twitterific.</li><li>Surfing all kinds of maps, and wikipedia in some social context. If I ever get into an argument about where a country is exactly, I&#8217;m pull up my iPad instantly and check it.</li></ul><p>And that concludes this iPad review.</p><div
id="attachment_607" class="wp-caption alignnone" style="width: 310px"><a
href="http://friendlybit.com/wp-content/uploads/2010/04/ipad_off_and_banana.jpg"><img
class="size-medium wp-image-607" title="iPad turned off" src="http://friendlybit.com/wp-content/uploads/2010/04/ipad_off_and_banana-300x225.jpg" alt="" width="300" height="225" /></a><p
class="wp-caption-text">iPad rests here, next to banana.</p></div><p>As usual<strong> </strong>I&#8217;m looking forward to<strong> your thoughts in the comments</strong>. Thanks for reading!</p> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=6uMCf680B64:HQuPVVMP0Ck:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=6uMCf680B64:HQuPVVMP0Ck:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=6uMCf680B64:HQuPVVMP0Ck:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=6uMCf680B64:HQuPVVMP0Ck:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=6uMCf680B64:HQuPVVMP0Ck:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/modern-web/my-ipad-a-short-review/feed/</wfw:commentRss> <slash:comments>29</slash:comments> </item> <item><title>Rendering a web page – step by step</title><link>http://friendlybit.com/css/rendering-a-web-page-step-by-step/</link> <comments>http://friendlybit.com/css/rendering-a-web-page-step-by-step/#comments</comments> <pubDate>Mon, 11 Jan 2010 00:04:33 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[Browsers]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[JS]]></category><guid isPermaLink="false">http://friendlybit.com/?p=580</guid> <description><![CDATA[Have you ever thought about what happens when you surf the web? It&#8217;s not as simple as it seems: You type an URL into address bar in your preferred browser. The browser parses the URL to find the protocol, host, port, and path. It forms a HTTP request (that was most likely the protocol) To [...]]]></description> <content:encoded><![CDATA[<p>Have you ever thought about what happens when you surf the web? It&#8217;s not as simple as it seems:</p><ol><li>You <strong>type an URL</strong> into address bar in your preferred browser.</li><li>The browser <strong>parses the URL</strong> to find the protocol, host, port, and path.</li><li>It <strong>forms a HTTP request</strong> (that was most likely the protocol)</li><li>To reach the host, it first needs to <strong>translate </strong>the human readable host<strong> into an IP number</strong>, and it does this by doing a DNS lookup on the host</li><li>Then a <strong>socket needs to be opened</strong> from the user&#8217;s computer to that IP number, on the port specified (most often port 80)</li><li>When a connection is open, the <strong>HTTP request is sent</strong> to the host</li><li>The host <strong>forwards the request</strong> to the server software (most often Apache) configured to listen on the specified port</li><li>The <strong>server inspects the request</strong> (most often only the path), and <strong>launches the server plugin needed</strong> to handle the request (corresponding to the server language you use, PHP, Java, .NET,  Python?)</li><li>The plugin gets access to the full request, and starts to prepare a HTTP response.</li><li>To construct the response a <strong>database </strong>is (most likely) <strong>accessed</strong>. A database search is made, based on parameters in the path (or data) of the request</li><li>Data from the database, together with other information the plugin decides to add, is <strong>combined into a long string</strong> of text (probably HTML).</li><li>The plugin <strong>combines </strong>that data with some meta data (in the form of HTTP headers), and <strong>sends the HTTP response</strong> back to the browser.</li><li>The browser receives the response, and <strong>parses the HTML</strong> (which with 95% probability is broken) in the response</li><li>A <strong>DOM tree is built</strong> out of the broken HTML</li><li><strong>New requests are made</strong> to the server for each new resource that is found in the HTML source (typically images, style sheets, and JavaScript files). Go back to step 3 and repeat for each resource.</li><li><strong>Stylesheets are parsed</strong>, and the rendering information in each gets attached to the matching node in the DOM tree</li><li><strong>Javascript is parsed and executed</strong>, and DOM nodes are moved and style information is updated accordingly</li><li>The browser <strong>renders the page</strong> on the screen according to the DOM tree and the style information for each node</li><li><strong>You</strong><strong> see</strong> the page on the screen</li><li>You get annoyed the whole process was too slow.</li></ol><p>I, too, get annoyed when the above steps take longer than one tenth of a second. But now at least I have some documentation to look at, while waiting the remaining fractions of a second before the page renders.</p><p><a
href="http://www.flickr.com/photos/amboo213/115034446/sizes/s/"><img
class="alignnone" title="Spoiled dog - by amboo213 on Flickr" src="http://farm1.static.flickr.com/45/115034446_8bf43c2273_m.jpg" alt="Spoiled dog" width="240" height="180" /></a></p><p>Spoiled we are, all of us.</p><p><em>(Feel free to add more steps, through the comments&#8230;)</em></p> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=lQFEvgZxzOs:4veCUiQC8DE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=lQFEvgZxzOs:4veCUiQC8DE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=lQFEvgZxzOs:4veCUiQC8DE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=lQFEvgZxzOs:4veCUiQC8DE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=lQFEvgZxzOs:4veCUiQC8DE:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/css/rendering-a-web-page-step-by-step/feed/</wfw:commentRss> <slash:comments>20</slash:comments> </item> <item><title>Position: fixed CSS templates</title><link>http://friendlybit.com/css/position-fixed-css-templates/</link> <comments>http://friendlybit.com/css/position-fixed-css-templates/#comments</comments> <pubDate>Thu, 31 Dec 2009 14:14:26 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[CSS]]></category><guid isPermaLink="false">http://friendlybit.com/?p=573</guid> <description><![CDATA[In 2006 I wrote an article about simulating Frames and Iframes and from time to time, I get questions of how to make modifications to the templates presented. But one big thing has changed since 2006: Perfect support for IE6 is no longer mandatory. So yesterday, when Brandon Cobb of Super Fighter Team asked about [...]]]></description> <content:encoded><![CDATA[<p>In 2006 I wrote an article about <a
href="http://friendlybit.com/css/frames-or-iframes-with-css/">simulating Frames and Iframes</a> and from time to time, I get questions of how to make modifications to the templates presented. But one big thing has changed since 2006: <strong>Perfect support for <abbr
title="Internet Explorer 6">IE6</abbr> is no longer mandatory</strong>.</p><p>So yesterday, when Brandon Cobb of <a
href="http://superfighter.com/">Super Fighter Team</a> asked about a design with a fixed header, fixed left column, and scrolling right column, I thought I&#8217;d renew my take on <a
href="http://friendlybit.com/css/frames-or-iframes-with-css/">simulating frames</a> with CSS (The original article is still good for background information, so I still recommend reading it).</p><h2>Position: fixed CSS templates</h2><p>The idea is this: Instead of specifying what parts of the page should scroll, we can <strong>specify what parts should stay fixed when scrolling</strong>. This makes it easier to deal with several fixed parts of the same layout, but also allows us do to things frames cannot do.</p><p>So what&#8217;s the trick? Well, <code >position: fixed</code> does exactly what we want. It works just like <code >position: absolute</code>, but it stays still when the page is scrolled. So it&#8217;s really just a matter of making sure things don&#8217;t overlap.</p><ul><li><a
href="http://friendlybit.com/files/fixed/fixedtopandleft.html">Demo: Fixed top, fixed left, scrolling right</a></li><li><a
href="http://friendlybit.com/files/fixed/fixedtop.html">Demo: Fixed top, scrolling bottom</a></li><li><a
href="http://friendlybit.com/files/fixed/fixedleft.html">Demo: Fixed left, scrolling right</a></li></ul><p><strong>Try resizing the page, and see how the scrolling works</strong>. The templates have been tested in: Fx 3.5, IE8, IE7, IE6 (see note below), Opera 10, Safari 4; all on Windows. Let me know if you can test it on more browsers, or find bugs.</p><p>You&#8217;re of course free to use this templates as you see fit, with or without a link back, commercially or not. Consider it public domain.</p><h2>Fixes for IE6</h2><p>As I&#8217;ve said, these designs don&#8217;t act the same in IE6. Instead of some parts being fixed, the whole page scrolls in IE6. The good thing about this is that <strong> IE6 users won&#8217;t see that your site is &#8220;broken&#8221;</strong>, they will just get another design. And as the number of IE6 users goes towards zero, your design will be more and more consistent :). The fallback is very simple, IE6 gets <code >position: absolute</code> instead of fixed, using the <a
href="http://www.webdevout.net/css-hacks#in_css-important">!important hack</a> (you should probably use <a
href="http://www.quirksmode.org/css/condcom.html">conditional comments</a> instead).</p><p>Hope these templates are useful for some of you!</p> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=DgopdFOXSlM:4FJEHJQ0FCM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=DgopdFOXSlM:4FJEHJQ0FCM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=DgopdFOXSlM:4FJEHJQ0FCM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=DgopdFOXSlM:4FJEHJQ0FCM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=DgopdFOXSlM:4FJEHJQ0FCM:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/css/position-fixed-css-templates/feed/</wfw:commentRss> <slash:comments>13</slash:comments> </item> <item><title>Google support gone wrong</title><link>http://friendlybit.com/other/google-support-gone-wrong/</link> <comments>http://friendlybit.com/other/google-support-gone-wrong/#comments</comments> <pubDate>Sat, 24 Oct 2009 13:00:28 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[Other topics]]></category><guid isPermaLink="false">http://friendlybit.com/?p=566</guid> <description><![CDATA[Google really produces great software. I use many of them: Web Search, Picasa, Reader, Feedburner, Analytics, Images, Groups, Docs, Translate, Code, Chrome, Maps, Video, Blog Search, Youtube, AJAX API, Webmaster Central, and Site Search. Just to name a few :) Problem is, with many of the above, if something breaks you&#8217;re out of luck. Because [...]]]></description> <content:encoded><![CDATA[<p>Google really produces great software. I use many of them: Web Search, Picasa, Reader,  Feedburner, Analytics, Images, Groups, Docs, Translate, Code, Chrome, Maps, Video, Blog Search, Youtube, AJAX API, Webmaster Central, and Site Search.</p><p>Just to name a few :)</p><p>Problem is, with many of the above, if something breaks you&#8217;re out of luck. Because it&#8217;s <strong>god damn impossible</strong> to get a hold of someone that you can talk to. Do you reach anyone at Google with your e-mails? Does anyone from Google read your forum posts? Highly unlikely.</p><p>Google is a great example of support gone wrong. I think the explanation is easy: Few of the programmers I know want to deal with support. They want to deal with coding! And since Google is a company of programmers, it doesn&#8217;t want to do support.</p><p>Let me tell two stories:</p><h2>Feedburner</h2><p>Feedburner once was a great company, with a simple but thought out service. They gave you subscriber statistics of your RSS feed. You just redirected your feed to them, and made all your subscribers sign up to their generated feed, and they did all the tricky calculations. Simple, efficient.</p><p>As a company Feedburner understood the value of being personal. Messages throughout the site stated &#8220;My feeds like a little namespace to call their own&#8221;, &#8220;Sometimes your feed just wants to look good. Spruce it up in the following ways&#8221;, &#8220;Oh dear, what kind of trouble?&#8221;. Nice personal touch :) Feedburner developers where easy to get in touch with, an e-mail and you had a friendly, knowledgeable person to talk to.</p><p>Then Google came along and bought the whole thing. Everything was rewritten to Google&#8217;s platform, domains where switched, and chaos ensued. Of course, during that time, Feedburner&#8217;s previous support people totally vanished, and everyone was directed to the Feedburner Status Blog, when you could confirm they where <strong>not </strong>working on your problem. Just great.</p><p>For three weeks now, my subscriber stats have jumped from 800 to 3000, back an forth, several times per week. Nice, isn&#8217;t it?</p><p><img
class="alignnone size-full wp-image-567" title="feedburner_stats" src="http://friendlybit.com/wp-content/uploads/2009/10/feedburner_stats.PNG" alt="feedburner_stats" width="519" height="165" /></p><p>Feedburner is apparently broken, and the simple service of delivering feed statistics doesn&#8217;t work.</p><p>So I <a
href="http://groups.google.com/group/feedburner-statistics/browse_thread/thread/3989f82b9efc3b26/e0990145155dca15?lnk=gst&amp;q=subscriber&amp;pli=1">post to their Google Group</a>, the place where you should ask questions about the service. Three months later, several other users have reported having the same problem, but no reply from a Feedburner developer.</p><p>Now I&#8217;m thinking of switching. Anyone have a good alternative ready?</p><h2>Google Wave</h2><p>Services that start at Google are even less likely, compared to acquired services like Feedburner, to have proper support. It&#8217;s just not a priority, and there&#8217;s far too many interesting programming challenges to deal with users.</p><p>So when Wave gives me an old picasa name as my username (&lt;company name&gt;.&lt;place of one of our conferences&gt;@googlewave.com), I know there&#8217;s very little chance that I&#8217;ll get help from anywhere. The official channel to ask for help is their support forum, but it doesn&#8217;t seem that they reply to issues there. <a
href="http://www.google.com/support/forum/p/wave/thread?tid=6cb8ca45d22453e5&amp;hl=en">My message there from two weeks ago</a> stands on it&#8217;s own, with no replies.</p><p>It&#8217;s the proposed revolution that will replace e-mail, and I can&#8217;t use it :(</p><h2>Bad trend</h2><p>This trend of Google not offering even basic support from dedicated people is a unfortunate development, that should be taken seriously by executives at Google, and dealt with at a very high level.</p><p>Launching new web services is easy, improving a services based on feedback is much harder. Google has not yet managed to crack that nut.</p> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=hevv1mC2Vno:0JyeRnshgyU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=hevv1mC2Vno:0JyeRnshgyU:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=hevv1mC2Vno:0JyeRnshgyU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=hevv1mC2Vno:0JyeRnshgyU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=hevv1mC2Vno:0JyeRnshgyU:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/other/google-support-gone-wrong/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> <item><title>Google Chrome as an Internet Explorer plugin</title><link>http://friendlybit.com/browsers/google-chrome-as-an-internet-explorer-plugin/</link> <comments>http://friendlybit.com/browsers/google-chrome-as-an-internet-explorer-plugin/#comments</comments> <pubDate>Wed, 23 Sep 2009 14:15:49 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[Browsers]]></category><guid isPermaLink="false">http://friendlybit.com/?p=560</guid> <description><![CDATA[I just encountered a quite mindboggling piece of news on the Google Wave blog. It seems they have decided not to support Internet Explorer at all. Not IE6, IE7 or IE8. Surprised? I sure was. What&#8217;s even better is that to still give these users the opportunity to use Google Wave, they&#8217;ve built a plugin [...]]]></description> <content:encoded><![CDATA[<p>I just encountered a quite mindboggling piece of news on the Google Wave blog. It seems they have decided <strong>not to support Internet Explorer at all</strong>. Not IE6, IE7 or IE8. Surprised? I sure was. What&#8217;s even better is that to still give these users the opportunity to use Google Wave, they&#8217;ve built a plugin for Internet Explorer, that loads the <a
href="http://googlewavedev.blogspot.com/2009/09/google-wave-in-internet-explorer.html">Chrome browser with Google Wave inside it</a>.</p><p><strong>What?</strong> Load a browser as a plugin inside another one? I guess this is a real war after all? Who will build the first browser to load Firefox into Chrome? Internet Explorer inside Firefox?</p><p><strong>Why?</strong> Well, now they don&#8217;t have to care about Internet Explorer support at all. Felt that heavy weight lift from your shoulders? Suddenly large parts of HTML5, CSS3, and modern javascript, is available to them, with no backporting and performance tuning needed. Must be fabulous.</p><p>Now. Combine that with the possibility for the developer to <a
href="http://blog.chromium.org/2009/09/introducing-google-chrome-frame.html">choose when to trigger the different browsers</a>. We&#8217;re up for a whole new ride. You&#8217;re invited.</p> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=AIwR9tIFU5U:aB3fXgTyW3U:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=AIwR9tIFU5U:aB3fXgTyW3U:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=AIwR9tIFU5U:aB3fXgTyW3U:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=AIwR9tIFU5U:aB3fXgTyW3U:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=AIwR9tIFU5U:aB3fXgTyW3U:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/browsers/google-chrome-as-an-internet-explorer-plugin/feed/</wfw:commentRss> <slash:comments>14</slash:comments> </item> <item><title>SpriteMe – Combine images and get fewer HTTP requests</title><link>http://friendlybit.com/css/spriteme-combine-images-and-get-fewer-http-requests/</link> <comments>http://friendlybit.com/css/spriteme-combine-images-and-get-fewer-http-requests/#comments</comments> <pubDate>Sat, 19 Sep 2009 15:09:02 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[CSS]]></category><guid isPermaLink="false">http://friendlybit.com/?p=557</guid> <description><![CDATA[Those of you that care about website performance have probably read about combining images, something that&#8217;s called &#8220;CSS sprites&#8221;. The idea is that by using the same (somewhat larger) image several times, you get fewer HTTP requests to your site, and therefore speed it up. Problem is, most of your images are CSS background images, [...]]]></description> <content:encoded><![CDATA[<p>Those of you that care about website performance have probably read about combining images, something that&#8217;s called &#8220;CSS sprites&#8221;. The idea is that by using the same (somewhat larger) image several times, you get fewer HTTP requests to your site, and therefore speed it up. Problem is, most of your images are CSS background images, that are positioned using clever background-positions and repeats.</p><p>Now, this makes to tricky to combine images. Something that repeats horizontally can&#8217;t be combined with something that repeats vertically (unless there&#8217;s transparency involved), and wide images can&#8217;t be combined with narrow ones. So combining is usually tedious, manual work, both to combine the images and then calculate the new background-positions required.</p><p>Lucky for us then, that there is a tool called <a
href="http://spriteme.org/">SpriteMe</a>, available as a bookmarklet (a bookmark containing javascript), and as an excellent <a
href="http://spriteme.org/demo.php">online demo</a> that walks you through how it works. SpriteMe does all the hard work for you, you just have to copy and paste both the combined images, and the new background rules, to your site.</p><p>Decreasing the number of HTTP requests have never been simpler. Well done <a
href="http://www.stevesouders.com/">Steve Souders</a>!</p> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=Q_3EbDKCpww:WUg9gBx0CTk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=Q_3EbDKCpww:WUg9gBx0CTk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=Q_3EbDKCpww:WUg9gBx0CTk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=Q_3EbDKCpww:WUg9gBx0CTk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=Q_3EbDKCpww:WUg9gBx0CTk:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/css/spriteme-combine-images-and-get-fewer-http-requests/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Voddler – movie streaming for the masses?</title><link>http://friendlybit.com/other/voddler-movie-streaming-for-the-masses/</link> <comments>http://friendlybit.com/other/voddler-movie-streaming-for-the-masses/#comments</comments> <pubDate>Sun, 30 Aug 2009 22:12:46 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[Other topics]]></category><guid isPermaLink="false">http://friendlybit.com/?p=549</guid> <description><![CDATA[I&#8217;ve recently managed to get a hold of a beta invite to Voddler, and thought I should tell you a little about my experience of it. But first, big thanks to Gunnar Bark (Tweets in Swedish, follow him!) who tipped me off about a Voddler invitation competition. It was run by Christian Rudolf at mjukvara.se [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve recently managed to get a hold of a beta invite to <a
href="http://www.voddler.com/">Voddler</a>, and thought I should tell you a little about my experience of it. But first, big thanks to <a
href="http://twitter.com/GunnarBark">Gunnar Bark</a> (Tweets in Swedish, follow him!) who tipped me off about a Voddler invitation competition. It was run by Christian Rudolf at <a
href="http://www.mjukvara.se/blogg/">mjukvara.se</a> (In Swedish, but definitely something to add to your feeds) who had 15 invites to give away.</p><p>Anyway.</p><p>Two years ago, <a
href="http://friendlybit.com/other/spotify-is-a-lot-like/">I got to test Spotify</a>, a music streaming that will soon launch in the US and is heavily anticipated. It completely changed how I listened to music, I deleted all my mp3:s and is now streaming all my music. <a
href="http://www.voddler.com/">Voddler</a> is a similar streaming service, but for movies.</p><p>So, what do I think of it?</p><p>First of all, Voddler is in a very early phase of testing. It&#8217;s what I would call a &#8220;<strong>real beta</strong>&#8220;, where the client crashes frequently, subtitles sometimes lag behind, the interface is tricky to use, and several features just don&#8217;t work.</p><p>Thing is, I&#8217;m quite certain Voddler will <strong>revolutionize how I watch movies</strong>, anyway. Because at the core of Voddler is HD-quality streaming, that just works. Believe me, I normally don&#8217;t watch that many movies, but have seen <strong>four</strong>,<strong> </strong>in the last 48 hours. They are just a couple of clicks away, and start in 10 seconds (during which you&#8217;ll watch a commercial). Here&#8217;s some <a
href="http://pappmaskin.no/2009/07/voddler-screenshots-and-details/">screenshots</a>.</p><p>Now. I&#8217;m saying that the client is a beta, and that there are serious bugs left, what kind of bugs do I mean?</p><ul><li>About half of the <strong>menu options don&#8217;t work</strong>. &#8220;Tv series&#8221; lead nowhere, I can&#8217;t browse movies by actor, director, studio, and several genres are empty. In my opinion, they would gain a lot by just <strong>removing those options until they lead somewhere</strong>! This is a no-brainer.</li><li>The <strong>client freezes and crashes</strong> regularly, and I have never been able to watch two movies in a row without restarting in between. This of course requires squashing bugs that are left in the code, and <strong>improve the testing procedure</strong>, so that such bugs never reach production code. Using mozilla-style reporting that allow people to <strong>send in crash reports</strong> is probably a good idea at this stage. The code is based on <a
href="http://en.wikipedia.org/wiki/XBMC">XBMC</a>, and people say stuff like &#8220;how could they add that many bugs to a product that good?!&#8221;. Voddler, don&#8217;t make it that easy to dismiss your hard work!</li><li>Sometimes the <strong>subtitles skip some lines</strong>. I watched <a
href="http://www.imdb.com/title/tt0325005/">Antikiller</a>, a russian action movie, five times important lines were shown only half a second on the screen, making me miss important pieces of the story. I&#8217;m not sure if this had something to do with the subtitles for that exact movie, or lag because of Voddler, but I know that it was a crappy first impression of the client. It just has to be fixed.</li><li>The <strong>support forum is so slow it&#8217;s unusable</strong>. My guess is that it&#8217;s on the same network as the movie streaming service, and therefore goes down together with that one. Those two just <strong>have to </strong>be independent, as you need the forum most when the other is down.</li><li>The <strong>UI doesn&#8217;t work usability-wise</strong>. First of all, it&#8217;s built for television sets, which means that only the keyboard works (arrow keys, space and esc), no mouse support. Several of the menues cycle (when you&#8217;re on the end the first item appears again), so you&#8217;ll easily loose track of where you are. There are small errors all over the place, things that makes finding and starting movies difficult.</li></ul><p>So, in summary, the core of Voddler is good, but the interface needs quite a lot of work before it can be released to the public. No matter what, I&#8217;ll keep following the development of this product!</p><p>In general, it seems that when you Americans stop us from using your servies (ie. <a
href="http://www.voddler.com">Hulu</a>), we Swedes build our own services. First Spotify, now Voddler.</p> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=gXPLMsT3tIQ:sDkNx3FaUfI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=gXPLMsT3tIQ:sDkNx3FaUfI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=gXPLMsT3tIQ:sDkNx3FaUfI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=gXPLMsT3tIQ:sDkNx3FaUfI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=gXPLMsT3tIQ:sDkNx3FaUfI:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/other/voddler-movie-streaming-for-the-masses/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Techniques to use when IE6 dies</title><link>http://friendlybit.com/css/techniques-to-use-when-ie6-dies/</link> <comments>http://friendlybit.com/css/techniques-to-use-when-ie6-dies/#comments</comments> <pubDate>Wed, 26 Aug 2009 21:54:51 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[Browsers]]></category> <category><![CDATA[CSS]]></category><guid isPermaLink="false">http://friendlybit.com/?p=496</guid> <description><![CDATA[Everyone except Microsoft themselves are talking about the death of IE6. I&#8217;ve tried motivating people to drop support, arguing that you at least can show IE6 users a message. Many have replied with &#8220;but our IT department doesn&#8217;t let us&#8230;&#8221;, and I can say nothing more than that the IT department is filled with humans. [...]]]></description> <content:encoded><![CDATA[<p>Everyone<a
href="http://www.eweek.com/c/a/Windows/Microsoft-Internet-Explorer-6-Support-Continues-Despite-Calls-for-PhaseOut-307122/"> except Microsoft themselves</a> are talking about the death of IE6. I&#8217;ve tried <a
href="/browsers/motivation-for-building-for-ie6/">motivating people to drop support</a>, arguing that you at least can show IE6 users a message. Many have replied with &#8220;but our IT department doesn&#8217;t let us&#8230;&#8221;, and I can say nothing more than that the IT department is filled with humans. Which means they are lazy, and upgrade when people whine enough about it. It&#8217;s a shame it has to be that way, that we have to <a
href="http://www.ie6nomore.com/corporate-users.html">punish people for their IT departments</a>, but that&#8217;s how it has to be.</p><p>As <strong>web developers</strong>, we should be the ones complaining the loudest. We have so much to win on IE6:s death it&#8217;s silly. Just look at the below list of things IE6 can&#8217;t do, but IE7 can (the next worst browser):</p><ul><li>Native PNG alpha transparency without silly hacks.</li><li>Several selectors: <a
href="http://crusher.w3.org/TR/CSS2/selector.html#child-selectors">Child selector</a> (&#8220;&gt;&#8221;), <a
href="http://crusher.w3.org/TR/CSS2/selector.html#adjacent-selectors">Adjacent sibling selector</a> (&#8220;+&#8221;), <a
href="http://crusher.w3.org/TR/CSS2/selector.html#attribute-selectors">Attribute selectors</a> ([attr=value]), and <a
href="http://www.w3.org/TR/css3-selectors/#general-sibling-combinators">General sibling selector</a> (&#8220;~&#8221;, CSS3)</li><li>Min-height, Max-height, Min-width, Max-width</li><li>Multiple class/id selectors in the same ruleset (ie. .class1.class2 { &#8230; })</li><li>:hover on all elements, not just links</li><li>position: fixed</li><li>Native XMLHTTP (Without ActiveX)</li><li>International Domain Names (IDN), the ability to use UTF-8 chars in domains</li><li>Page zoom that zooms the whole page (don&#8217;t worry about zoom)</li></ul><p>This is a huge step forward for us web developers. Huge! Bigger then when CSS3 comes out, because we won&#8217;t be able to use that one for years. Someone is pushing the front of what&#8217;s possible, I&#8217;m pushing for the front of what&#8217;s <strong>usable</strong>.</p><p>What can you do to help me get everything in the above list? And, did I forget something?</p><p>Sources:</p><ul><li><a
href="http://www.quirksmode.org/css/contents.html">CSS Compatibility charts</a></li><li><a
href="http://blogulate.com/content/new-features-of-internet-explorer-7/">IE6 vs IE7 &#8211; New features in Internet Explorer 7</a></li></ul> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=DVSoywhUfCQ:MM_JG_bHi1I:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=DVSoywhUfCQ:MM_JG_bHi1I:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=DVSoywhUfCQ:MM_JG_bHi1I:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=DVSoywhUfCQ:MM_JG_bHi1I:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=DVSoywhUfCQ:MM_JG_bHi1I:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/css/techniques-to-use-when-ie6-dies/feed/</wfw:commentRss> <slash:comments>33</slash:comments> </item> <item><title>Tapestry 5, and how not to treat HTML</title><link>http://friendlybit.com/html/tapestry-5-and-how-not-to-treat-html/</link> <comments>http://friendlybit.com/html/tapestry-5-and-how-not-to-treat-html/#comments</comments> <pubDate>Thu, 23 Jul 2009 19:39:10 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[HTML]]></category><guid isPermaLink="false">http://friendlybit.com/?p=528</guid> <description><![CDATA[I&#8217;ve previously written about how Microsoft Sharepoint mistreats HTML, and makes it look a whole other language. But truth to be told, Sharepoint (and .NET for that matter) isn&#8217;t the only framework that can&#8217;t handle HTML. I&#8217;ve recently worked with a Java framework called Tapestry 5, and it&#8217;s really bad in some respects too (though [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve previously written about how <a
href="http://friendlybit.com/html/default-html-in-sharepoint-2007/">Microsoft Sharepoint</a> mistreats HTML, and makes it look a whole other language. But truth to be told, Sharepoint (and .NET for that matter) isn&#8217;t the only framework that can&#8217;t handle HTML. I&#8217;ve recently worked with a Java framework called <a
href="http://tapestry.apache.org/">Tapestry 5</a>, and it&#8217;s really bad in some respects too (though not quite as bad as Sharepoint). Note that this is a review based on <strong>only</strong> how it handles HTML, not any other of its merits. Let&#8217;s get started.</p><p>Many of Tapestry&#8217;s problems comes from their design decision to parse the HTML you&#8217;re trying to output. Yes, Tapestry parses your HTML, and adds stuff to it dynamically. This is nothing new, anyone that has played with ASP.NET knows how hidden form elements get stuffed in here and there. This is a nightmare for an interface developer, we need exact control over HTML to do our jobs well.</p><p>Tapestry does horrible things to HTML:</p><ul><li><strong>Several extra javascripts and CSS files</strong> are referenced in the head tag. There is no simple way to get rid of these.</li><li><strong>A meta tag</strong> which states that the tapestry did generate this page, is added.</li><li>The two above are added to the head, and if a <strong>head tag doesn&#8217;t exist, it gets added</strong>. Never mind that your current little HTML snippet was just a little part of a page, that was being fetched with AJAX, Tapestry will add a head tag for you.</li><li><strong>More javascript, and a hidden div</strong> with a firebug-like console, is appended to the end of the body element.</li><li><strong>Self-closing tags are expanded</strong> to a start tag and an end tag (&lt;input /&gt; gets transformed to &lt;input&gt;&lt;/input&gt;), which means you can&#8217;t use XHTML together with Tapestry.</li><li><strong>All whitespace is removed</strong> by default, and you have to disable the &#8220;feature&#8221; on a tag-by-tag basis (&#8220;Please don&#8217;t strip whitespace inside this list, IE6 goes crazy then&#8221;). This is a mess for interface developers, who know that whitespace matters for rendering. It was even <a
href="https://issues.apache.org/jira/browse/TAPESTRY-2028">pointed out to Tapestry developers</a> early on, but was ignored.</li><li> There are ways to do loops, if:s, reference variables and generate URL:s, but all of these are based on the HTML parsing. And as a good parser, <strong>it skips all comments</strong>. This means using tapestry template code inside a HTML comment will not work. When do you need that? Conditional comments! So what if you want an URL generated to your IE6 stylesheet? No go. You&#8217;ll have to write a custom component that does that for you.</li><li>Changes the <strong>id of all your forms to &#8220;form&#8221; and adds name=&#8221;form&#8221;</strong> (which is invalid HTML).</li><li>Adds a <strong>hidden &#8220;t:formdata&#8221; field to forms</strong>, much like the dreaded ASP.NET viewstate.</li><li>One of the javascript files added is <a
href="http://www.prototypejs.org/">prototype</a>, a javascript framework which isn&#8217;t compatible with jQuery. So you have to rewrite your javascript code to work in &#8220;No conflicts mode&#8221; if you want it to work with Tapestry.</li></ul><p>No. Tapestry was clearly not built with an interface developer in mind. Why is it so hard for many web framework developers to just talk with people that work with HTML, CSS, and Javascript? Please ask us <strong>before</strong> implementing stuff like the above. We&#8217;ll gladly give you our viewpoint.</p> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=NRs__09y7y0:J3ScXLEwueU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=NRs__09y7y0:J3ScXLEwueU:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=NRs__09y7y0:J3ScXLEwueU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=NRs__09y7y0:J3ScXLEwueU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=NRs__09y7y0:J3ScXLEwueU:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/html/tapestry-5-and-how-not-to-treat-html/feed/</wfw:commentRss> <slash:comments>28</slash:comments> </item> <item><title>Make a div clickable</title><link>http://friendlybit.com/js/make-a-div-clickable/</link> <comments>http://friendlybit.com/js/make-a-div-clickable/#comments</comments> <pubDate>Tue, 30 Jun 2009 20:53:25 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[JS]]></category><guid isPermaLink="false">http://friendlybit.com/?p=498</guid> <description><![CDATA[We all dislike that links are so small, and hard to click. So of course we want to make the clickable areas bigger. Some would think that doing this with some CSS on the a-tag would be a good way, but then you can&#8217;t have block level elements inside it (you&#8217;ll get a validation error [...]]]></description> <content:encoded><![CDATA[<p>We all dislike that links are so small, and hard to click. So of course we want to make the clickable areas bigger. Some would think that doing this with some CSS on the a-tag would be a good way, but then you can&#8217;t have block level elements inside it (you&#8217;ll get a validation error if you try to put headings or paragraph tags inside of links). So what&#8217;s a more general solution?</p><p>My take is to use a div instead, and use javascript, of course together with a good fallback. When clicking the div, find the first link inside it, and go to that URL. It&#8217;s simple, and with a few additional quirks, it gets really useful.</p><p>Javascript code (requires jQuery):</p><pre><code >$(document).ready(function(){
   var block = $(".teaser");
   block.click(function(){
      window.location = $(this).find("a:first").attr("href")
   });
   block.addClass("clickable");
   block.hover(function(){
      window.status = $(this).find("a:first").attr("href")
   }, function(){
      window.status = ""
   })
});</code></pre><p>CSS for showing that the div actually is clickable:</p><pre><code >.clickable {
   cursor: pointer;
}
.clickable:hover {
   background: #efefef;
}</code></pre><p>A <a
href="/files/clickable_block/">clickable div demo</a> is of course available.</p><h2>How it works</h2><ul><li>When the div (or other tag, you choose) is clicked, find the <strong>first anchor tag</strong>, get it&#8217;s href attribute, and go there. Relying on an actual link means you always have a fallback, so no cheating.</li><li>When <strong>javascript is disabled</strong>, it just falls back to a regular block, where only the links are clickable.</li><li>A class called &#8220;clickable&#8221; is set on the block to allow for <strong>javascript-specific styling</strong>, such as changing the cursor with cursor: pointer, something you don&#8217;t want to happen when the block isn&#8217;t clickable.</li><li>The changing background color on <strong>hover is done with	 CSS</strong>, which I think is fair, considering the small percentage of users using IE6. Changing background color isn&#8217;t a must feature.</li><li>Lastly, since we&#8217;re simulating a link here, it should show where the link is going. I&#8217;ve done this by setting the statusbar to the link location on hover, something that&#8217;s useful when it works (users can disable this in some browsers).</li></ul><p>Hope that little snippet is useful for someone out there, I think it&#8217;s a good example of good use of javascript.</p> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=2aTCjjrcE3I:9bc97AWZv_4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=2aTCjjrcE3I:9bc97AWZv_4:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=2aTCjjrcE3I:9bc97AWZv_4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=2aTCjjrcE3I:9bc97AWZv_4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=2aTCjjrcE3I:9bc97AWZv_4:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/js/make-a-div-clickable/feed/</wfw:commentRss> <slash:comments>34</slash:comments> </item> <item><title>Why people skip newspapers and read news on the web instead</title><link>http://friendlybit.com/modern-web/why-people-skip-newspapers-and-read-news-on-the-web-instead/</link> <comments>http://friendlybit.com/modern-web/why-people-skip-newspapers-and-read-news-on-the-web-instead/#comments</comments> <pubDate>Thu, 25 Jun 2009 20:44:12 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[Modern web]]></category><guid isPermaLink="false">http://friendlybit.com/?p=494</guid> <description><![CDATA[You can&#8217;t be involved with what&#8217;s happening on the internet without coming in contact with the &#8220;newspaper crisis&#8221; somehow. From a business perspective it&#8217;s simple really: Much fewer people buy newspapers (on paper) nowadays. Please note that this has very little to do with advertisement or business models, I&#8217;m talking about newspapers from the user [...]]]></description> <content:encoded><![CDATA[<p>You can&#8217;t be involved with what&#8217;s happening on the internet without coming in contact with the &#8220;newspaper crisis&#8221; somehow. From a business perspective it&#8217;s simple really: Much fewer people buy newspapers (on paper) nowadays. Please note that this has very little to do with advertisement or business models, I&#8217;m talking about newspapers from the user perspective here.</p><p>Internet is really a commodity nowadays. People process loads of  information on the web every day, and this of course affects how they expect newspapers to behave. Every time I hold a big newspaper in my hands I&#8217;m surprised at how inferior it is compared to reading news on the web.</p><h2>Newspapers have problems with references</h2><p>If I find an interesting news story on the front page, it&#8217;s a mess finding the full article in there. The references are done with page numbers, but with page numbers that are local to a certain part of the paper. &#8220;Culture, page 7&#8243;. And the culture part is stacked inside the part I&#8217;m reading, so I first have to find that one, then find the page numbers (which are removed from pages with ads), and then finally find the article I wanted.</p><p>The same is true for related articles. If I read an article I like, it&#8217;s quite likely that I want to read other articles on the same subject. Newspapers solve this today by placing similar articles close to each other, and hope that you see them. This is of course limited, and gets harder when pages sizes shrink.</p><p>Compare this with clicking a link on the web. If I find an interesting article teaser, I click it, and am instantly taken to the full article. If that article was indeed as interesting as the teaser suggested, I&#8217;m often presented with similar articles, from similar categories, and can click them to move there.</p><h2>Newspapers are slow</h2><p>Even the most frequently published papers are only distributed once per day. This simply means that papers can&#8217;t compete on speed, being first with a certain story. Even if you happen to get your hands on a story at the perfect time, a paper still have to be both printed, and distributed to people. This takes hours.</p><p>What&#8217;s worse, morning newspapers brand themselves as dealing with  &#8220;today&#8217;s news&#8221;, when in fact it&#8217;s the news from yesterday. This hasn&#8217;t been a problem before, since there was no faster way to get news. Now there is.</p><p>If speed is important to you, you can easily subscribe to news via e-mail, Twitter or RSS, and be instantly updated.</p><h2>Newspapers are static</h2><p>Articles in a newspaper are, once published, not possible to update and improve. They are left for the wind, even though there are inaccuracies or important clarifications to be made. Any conversation sparked won&#8217;t be there.</p><p>This is of course the strongest argument for internet news. A big article will be different if you look at it later the same day. Comments and updates based on feedback are able to improve articles considerably.</p><h2>Newspapers don&#8217;t have enough unique content</h2><p>Big parts of daily newspapers contain poor rewrites, or plain copies, of articles from elsewhere. The reasoning is probably that they are trying to be exhaustive, give a broad view of what has happened. Problem is, they are hiding their own unique content behind loads of reposts of other&#8217;s content.</p><p>The same happens on the web, but instead of copying the article you link to it. Then you get to read the news from the real source, and dig in deeper if you want to. Additionally, there&#8217;s safegards that stop people from copying other people&#8217;s content. For instance, Google have special filters for filtering out duplicate content.</p><h2>Newspapers are not relevant enough</h2><p>The biggest reason why I don&#8217;t subscribe to any newspapers is that they are not relevant enough. I&#8217;m not one bit interested in sports, and still, during big sporting events newspapers push them to the front page, over interesting internet-related news; things I find interesting.</p><p>The key here is of course to realize that relevancy is in the eye of the beholder. Only <em>I</em> know what I find interesting, and relevant. Why trust someone else&#8217;s relevancy ranking when I can easily get my own ranking online? Even if I don&#8217;t want to tailor-pick RSS feeds and build my own custom news feed, there&#8217;s someone out there that has more similar taste than the four major newspapers here.</p><h2>So, what should newspapers do?</h2><p>Well, they have two options: <strong>One</strong>, they could keep writing articles, hoping that the quality will be high enough to turn the trend, or <strong>Two</strong>, they could start thinking of <strong>how</strong> they deliver news. The expectation of how news should be served is changing. It now needs to be delivered&#8230;</p><ol><li>&#8230; filled with references for digging deeper</li><li>&#8230; faster than once a day</li><li>&#8230; in a manner where people&#8217;s contributions enhance it</li><li>&#8230; with a quality stamp that ensures that you&#8217;re reading something you couldn&#8217;t get anywhere else</li><li>&#8230; personalized to my own specific taste. No sports.</li></ol><p>Is there any other way to do this than focusing aggressively on the web, and less on dead trees?</p> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=1Mf6HnZHY0U:u46J4PmKB8o:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=1Mf6HnZHY0U:u46J4PmKB8o:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=1Mf6HnZHY0U:u46J4PmKB8o:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=1Mf6HnZHY0U:u46J4PmKB8o:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=1Mf6HnZHY0U:u46J4PmKB8o:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/modern-web/why-people-skip-newspapers-and-read-news-on-the-web-instead/feed/</wfw:commentRss> <slash:comments>15</slash:comments> </item> <item><title>Swedish: Presentation om upplevelsedesign</title><link>http://friendlybit.com/tutorial/swedish-presentation-om-upplevelsedesign/</link> <comments>http://friendlybit.com/tutorial/swedish-presentation-om-upplevelsedesign/#comments</comments> <pubDate>Fri, 22 May 2009 11:33:18 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[Tutor]]></category><guid isPermaLink="false">http://friendlybit.com/?p=488</guid> <description><![CDATA[Som många av er vet så jobbar jag för ett konsultbolag som heter Valtech i stockholm. Via Valtech får jag ofta möjlighet att hålla föredrag om saker jag tycker är intressanta, och som jag tycker att våra kunder (och vi själva), borde satsa mera på. Den här gången var det upplevelsedesign: att inte bara sätta [...]]]></description> <content:encoded><![CDATA[<p>Som många av er vet så jobbar jag för ett konsultbolag som heter Valtech i stockholm. Via Valtech får jag ofta möjlighet att hålla föredrag om saker jag tycker är intressanta, och som jag tycker att våra kunder (och vi själva), borde satsa mera på. Den här gången var det upplevelsedesign: att inte bara sätta fokus på att användaren ska klara av specifika uppgifter, utan att bry sig om hur det känns att genomföra de uppgifterna. Kort sagt, att sikta lite högre.</p><p>Presentationen håller jag tillsammans med Visar, och Marwin, två av våra extremt duktiga Art Directors, och ni ser mig sist i presentationen.</p><p><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="288" id="viddler_51c3e438"><param
name="movie" value="http://www.viddler.com/player/51c3e438/" /><param
name="allowScriptAccess" value="always" /><param
name="allowFullScreen" value="true" /><embed
src="http://www.viddler.com/player/51c3e438/" width="437" height="288" type="application/x-shockwave-flash" allowScriptAccess="always" allowFullScreen="true" name="viddler_51c3e438"></embed></object></p> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=Z8sFIzO2y28:ErqKw7_4NJE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=Z8sFIzO2y28:ErqKw7_4NJE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=Z8sFIzO2y28:ErqKw7_4NJE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=Z8sFIzO2y28:ErqKw7_4NJE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=Z8sFIzO2y28:ErqKw7_4NJE:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/tutorial/swedish-presentation-om-upplevelsedesign/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Custom fonts using Cufón</title><link>http://friendlybit.com/browsers/custom-fonts-using-cufon/</link> <comments>http://friendlybit.com/browsers/custom-fonts-using-cufon/#comments</comments> <pubDate>Fri, 08 May 2009 18:20:17 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[Browsers]]></category> <category><![CDATA[Fonts]]></category><guid isPermaLink="false">http://friendlybit.com/?p=480</guid> <description><![CDATA[If you&#8217;ve worked with webdev professionally you know how it goes. &#8220;Why can&#8217;t a company with a strong visual brand get to use their own font?&#8221;, the designer asks. Then a long discussion about web fonts follow, where you decide to replace the font with a &#8220;web safe&#8221; font instead. Or do you? You could [...]]]></description> <content:encoded><![CDATA[<p>If you&#8217;ve worked with webdev professionally you know how it goes. &#8220;Why can&#8217;t a company with a strong visual brand get to use their own font?&#8221;, the designer asks. Then a long discussion about web fonts follow, where you decide to replace the font with a &#8220;web safe&#8221; font instead. Or do you?</p><p>You could think it&#8217;s strange that in 2009, we can&#8217;t use any fonts we want on the web, and I would fully agree. You could ask whose fault that is, and I would reply with a quote from a <a
href="http://www.w3.org/Fonts/Misc/minutes-2008-10">meeting between browser makers in august 2008</a>:</p><blockquote><p>&#8220;My understanding, from Chris, is that supporting         direct linking of the fonts would be a great disservice to the         independent font industry. <strong>A high-level decision within MS</strong> says         we won&#8217;t implement that in IE. So what is done other than EOT         is [probably] not going to interop with IE. &#8220;</p></blockquote><p>&#8220;MS&#8221; is of course Microsoft, and &#8220;Chris&#8221;, is referring to Chris Wilson, Platform Architect of the Internet Explorer Platform team. The same Chris has also written a <a
href="http://cwilso.com/2008/07/23/fonts-embedding-vs-linking/">longer text about font linking</a> on his blog. I first thought that this was something the font foundries had pushed through, but on the above post it seems that this is also a personal opinion. Browsers (but only IE) need to protect fonts from getting pirated.</p><p>And that&#8217;s the whole reason why we don&#8217;t have cross-browser fonts on the web today. (Although direct linking to fonts work in all the latest versions of Firefox, Opera, and Safari). Nice isn&#8217;t it?</p><h2>Embedding fonts anyway</h2><p>Of course, there&#8217;s still a need to embed custom fonts on webpages. That means clever developers will develop techniques will work around a broken internet explorer. No matter what the font founderies and Internet Explorer team thinks.</p><p>My reasoning for why this is a good thing is because that&#8217;s how everything else works in the browser. Even though anyone can copy an image, we have a big market for stock images. Even though anyone can copy the HTML, CSS, and Javascript of a whole site, we still have people building websites for money. <strong>Fonts are no different</strong>, and the exact same business model that works for stock images can work for fonts. <strong><br
/> </strong></p><p>One popular technique is <a
href="http://wiki.novemberborn.net/sifr/">sIFR</a>, a way to use javascript to replace regular html with flash. Inside the flash you embed the font you want, and voilá, you can use any font you want. sIFR misses one crucial point though: It&#8217;s far too annoying to embed a font inside a flash movie. You need a commercial program, and you need to know what you&#8217;re doing. And you&#8217;re dependent on flash support. It&#8217;s not that bad, but a bit annoying to work with.</p><p>So for a recent project I&#8217;ve been playing with <a
href="http://wiki.github.com/sorccu/cufon/about">Cufón</a>, which uses javascript, but draws on canvas, or in VML for browsers that don&#8217;t support canvas (IE). They have an extremely friendly website, which walks you through the process of getting things to work, and the font conversion needed is available directly on the website. I&#8217;ve only used it for simple cases, but it works really well.</p><p>All in all, Cufón is a great alternative until IE gets its shit together.</p><p>PS. Famous people that don&#8217;t agree with me:</p><ul><li><a
href="http://clagnut.com/">Richard Rutter</a>, author of the clagnut blog suggests that font founderies <a
href="http://clagnut.com/blog/2166/">server-side generate our fonts on demand</a>, much like Google Maps only sends a part of the map, and not all of it.</li><li><a
href="http://joeclark.org/">Joe Clark</a>: &#8220;Quite simply, there is <a
href="http://blog.fawny.org/2008/07/22/billhillsite/">no broad clamour</a> among Web <em>designers</em> to use any font they want.&#8221;</li><li><a
href="http://jasonsantamaria.com/">Jason Santa Maria</a>: &#8220;embedding normal typefaces without any sort of precautions is putting it on a silver platter for anyone to take freely. That’s like saying people steal from stores anyway, so <a
href="http://http://clagnut.com/blog/2166/#c4769">let’s just leave the doors unlocked</a> at night :)&#8221;</li><li>And of course, the IE team&#8230;</li><li>&#8230;and all the typeface makers in the world.</li></ul> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=bRJuPxcMVbA:FG-dK_fDgYk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=bRJuPxcMVbA:FG-dK_fDgYk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=bRJuPxcMVbA:FG-dK_fDgYk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=bRJuPxcMVbA:FG-dK_fDgYk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=bRJuPxcMVbA:FG-dK_fDgYk:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/browsers/custom-fonts-using-cufon/feed/</wfw:commentRss> <slash:comments>14</slash:comments> </item> <item><title>Projectors: a great accessibility argument</title><link>http://friendlybit.com/accessibility/projectors-a-great-accessibility-argument/</link> <comments>http://friendlybit.com/accessibility/projectors-a-great-accessibility-argument/#comments</comments> <pubDate>Fri, 03 Apr 2009 15:31:32 +0000</pubDate> <dc:creator>Emil Stenström</dc:creator> <category><![CDATA[Accessibility]]></category><guid isPermaLink="false">http://friendlybit.com/?p=470</guid> <description><![CDATA[So there I sat, at the demonstration of a new website I&#8217;ve been part of building. About 10 people in the room, some of which had never seen the site before. There had been preparations, and we had gone through which parts of the site we were going to present. Only the simple part left&#8230; [...]]]></description> <content:encoded><![CDATA[<p>So there I sat, at the demonstration of a new website I&#8217;ve been part of building. About 10 people in the room, some of which had never seen the site before. There had been preparations, and we had gone through which parts of the site we were going to present. Only the simple part left&#8230;</p><p>So the presenter fires up the projector, connects it to his Mac, and looks at the projection. Half the site is outside of the screen. Turns out the maximum resolution is 800&#215;600, and we&#8217;ve designed the site for 1024! People started looking at each other.</p><blockquote><p>&#8220;We have to be able to show the site with a projector!&#8221;, one from the audience proclaimed.</p></blockquote><p>Awkward silence.</p><p><img
class="secondary" src="http://farm1.static.flickr.com/34/110679756_98fdd45346.jpg?v=0" alt="" width="180" height="175" /></p><p>I&#8217;ve rarely heard people working with accessibility mention projectors as arguments for accessibility, but it turns out they are great for that purpose. Just look at it like this:</p><ul><li><strong>Resolution</strong> is often at the very low end, and they get upgraded much slower than regular computers.</li><li><strong>Brightness</strong> is much lower than on a computer screen, especially at daytime, in a room with bad curtains.</li><li>Many presenters <strong>move their mouse</strong> by looking at the projection, which makes clicking things harder.</li></ul><p>Interesting isn&#8217;t it? Those three just happens to be exactly the same things that we try to optimize when working with accessibility:</p><ul><li>We try to avoid having people to <strong>scroll sideways</strong>, because unexperienced users find that hard to do. A flexible design, that can adapt to different screen widths (within reason), is a great way to accomplish that.</li><li>We work hard to make sure that the contrast between page elements is big enough. That way, the large part of the population with low vision (don&#8217;t forget those that left their glasses at home&#8230;), can use the page without problems.</li><li>We expand clickable areas of links and buttons, to make sure people with motor disabilities can still use our site.</li></ul><p>So, we could just as well have been optimizing the &#8220;projector experience&#8221; all along.</p><p>How did the presentation go? Well, we simply zoomed the site out one step, and continued as usual. You are making sure your site zooms properly are you?</p> <div class="feedflare">
<a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=kMNM9TI8baw:Ihnl-pHWvZo:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=kMNM9TI8baw:Ihnl-pHWvZo:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=kMNM9TI8baw:Ihnl-pHWvZo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?i=kMNM9TI8baw:Ihnl-pHWvZo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.friendlybit.com/~ff/FriendlyBit?a=kMNM9TI8baw:Ihnl-pHWvZo:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/FriendlyBit?d=cGdyc7Q-1BI" border="0"></img></a>
</div>]]></content:encoded> <wfw:commentRss>http://friendlybit.com/accessibility/projectors-a-great-accessibility-argument/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> </channel> </rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 8/69 queries in 0.020 seconds using disk
Object Caching 923/1074 objects using disk

Served from: friendlybit.com @ 2010-09-02 09:57:33 -->
