<?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>morden.dk</title>
	<atom:link href="http://morden.dk/feed/" rel="self" type="application/rss+xml" />
	<link>http://morden.dk</link>
	<description>ramblings about frontend development</description>
	<lastBuildDate>Fri, 17 May 2013 11:50:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Web Components</title>
		<link>http://morden.dk/2013/web-components/</link>
		<comments>http://morden.dk/2013/web-components/#comments</comments>
		<pubDate>Fri, 17 May 2013 11:50:24 +0000</pubDate>
		<dc:creator>moe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://morden.dk/?p=393</guid>
		<description><![CDATA[This is still early stage, but if you have an hour or two, this shows you where web-app development is heading. Walkthrough of the elements: http://www.youtube.com/watch?v=eJZx9c6YL8k &#8211; and slides. Google devs (alpha) take on the concept with polyfills for almost &#8230; <a href="http://morden.dk/2013/web-components/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is still early stage, but if you have an hour or two, this shows you where web-app development is heading.</p>
<p>Walkthrough of the elements: <a href="http://www.youtube.com/watch?v=eJZx9c6YL8k" target="_blank">http://www.youtube.com/watch?v=eJZx9c6YL8k</a> &#8211; and <a href="http://html5-demos.appspot.com/static/webcomponents/index.html" target="_blank">slides</a>.</p>
<p>Google devs (alpha) take on the concept with polyfills for almost all of the features: <a href="http://polymer-project.appspot.com/" target="_blank">http://polymer-project.appspot.com/</a>. Just looking at the samples gives you a good idea of the benefits.</p>
<p>Actually Polymer.js lets you use the concepts today in ‘<a href="http://www.yetihq.com/blog/evergreen-web-browser/" target="_blank">Evergreen</a>’ browsers – but native support is when the benefits starts kicking in.</p>
<p>My advice would be to stay on the <a href="http://angularjs.org/" target="_blank">AngularJS</a> path, it is in line with where we’re going!</p>
<p>Trolling commence :)</p>
]]></content:encoded>
			<wfw:commentRss>http://morden.dk/2013/web-components/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Best Practices Podcast</title>
		<link>http://morden.dk/2012/javascript-best-practices-podcast/</link>
		<comments>http://morden.dk/2012/javascript-best-practices-podcast/#comments</comments>
		<pubDate>Sat, 14 Apr 2012 13:46:34 +0000</pubDate>
		<dc:creator>moe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Podcast]]></category>
		<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://morden.dk/?p=378</guid>
		<description><![CDATA[A follow-up on the presentation I did for ANUG a few months ago. I&#8217;m being interviewed by Søren Spelling and we have a friendly talk about this and that in danish. ANUGCast #157 JavaScript Best Practices part 1 ANUGCast #158 &#8230; <a href="http://morden.dk/2012/javascript-best-practices-podcast/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A follow-up on <a href="/talks/anug" target="_blank">the presentation</a> I did for <a href="http://www.anug.dk/" target="_blank">ANUG</a> a few months ago. I&#8217;m being interviewed by <a href="http://www.publicvoid.dk/" target="_blank">Søren Spelling</a> and we have a friendly talk about this and that <strong>in danish</strong>.</p>
<p><strong>ANUGCast #157 JavaScript Best Practices part 1</strong><br />
<embed src="http://www.anug.dk/mediaplayer/mediaplayer.swf" width="320" height="20" allowscriptaccess="always" allowfullscreen="true" flashvars="height=20&amp;width=320&amp;file=http://www.publicvoid.dk/content/binary/podcasts/ANUGCast-157-JavaScript-Best-Practices-med-Morten-Pedersen-del-1-af-2.mp3" /></p>
<p><strong>ANUGCast #158 JavaScript Best Practices part 2</strong><br />
<embed src="http://www.anug.dk/mediaplayer/mediaplayer.swf" width="320" height="20" allowscriptaccess="always" allowfullscreen="true" flashvars="height=20&amp;width=320&amp;file=http://www.publicvoid.dk/content/binary/podcasts/ANUGCast-158-JavaScript-Best-Practices-med-Morten-Pedersen-del-2-af-2.mp3"></p>
<p>You can also find them in their iTunes feed:<br />
<a href="http://itunes.apple.com/podcast/aarhus-.net-user-group/id298609451?subMediaType=Audio" target="_blank">itunes.apple.com/podcast/aarhus-.net-user-group/id298609451?subMediaType=Audio</a></p>
]]></content:encoded>
			<wfw:commentRss>http://morden.dk/2012/javascript-best-practices-podcast/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://www.publicvoid.dk/content/binary/podcasts/ANUGCast-157-JavaScript-Best-Practices-med-Morten-Pedersen-del-1-af-2.mp3" length="36013088" type="audio/mpeg" />
<enclosure url="http://www.publicvoid.dk/content/binary/podcasts/ANUGCast-158-JavaScript-Best-Practices-med-Morten-Pedersen-del-2-af-2.mp3" length="35796167" type="audio/mpeg" />
		</item>
		<item>
		<title>MOSS of Fury</title>
		<link>http://morden.dk/2012/moss-of-fury/</link>
		<comments>http://morden.dk/2012/moss-of-fury/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 21:02:52 +0000</pubDate>
		<dc:creator>moe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Off topic]]></category>

		<guid isPermaLink="false">http://morden.dk/?p=358</guid>
		<description><![CDATA[The other day I was looking through my backup drive and stumpled on a funny (like haha funny) thing I did a few years back. If you ever played World of Warcraft and at some point crossed paths with Microsoft &#8230; <a href="http://morden.dk/2012/moss-of-fury/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The other day I was looking through my backup drive and stumpled on a funny (like haha funny) thing I did a few years back. If you ever played World of Warcraft and at some point crossed paths with Microsoft Sharepoint, this is a laugh.</p>
<p>So without further ado I introduce the <span style="color:purple;">MOSS of Fury</span>.</p>
<p><img src="http://morden.dk/wp-content/uploads/2012/01/mossoffury.png" alt="MOSS of Fury" title="mossoffury" style="max-width:100%;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://morden.dk/2012/moss-of-fury/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Javascript Management &amp; Best Practices</title>
		<link>http://morden.dk/2012/javascript-management-best-practices/</link>
		<comments>http://morden.dk/2012/javascript-management-best-practices/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 09:32:07 +0000</pubDate>
		<dc:creator>moe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://morden.dk/?p=343</guid>
		<description><![CDATA[The other day I did a talk on structuring client code and getting more out of jQuery. Target audience was ANUG and getting these .NET&#8217;ers up to speed on the world of JS. A good read for anyone into frontend &#8230; <a href="http://morden.dk/2012/javascript-management-best-practices/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The other day I did a talk on structuring client code and getting more out of jQuery. Target audience was <a href="http://www.anug.dk/" title="Aarhus .NET User Group">ANUG</a> and getting these .NET&#8217;ers up to speed on the world of JS. </p>
<p>A good read for anyone into frontend development and there are loads of code samples and clever tricks ready to use in your next project. Also there are a few suggestions on how to get VS2010 up to speed when it comes to client side development.</p>
<p>You&#8217;ll find the HTML5 slides from the presentation here:</p>
<p><strong><a href="http://morden.dk/talks/anug" title="Javascript Managent">Javascript Management</a></strong><br />
(Chrome, Safari and FireFox only)</p>
]]></content:encoded>
			<wfw:commentRss>http://morden.dk/2012/javascript-management-best-practices/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Deep Linking and Indexing AJAX Applications &#8211; Google, Hashbang and state maintenance</title>
		<link>http://morden.dk/2012/deeplinking-and-indexing-ajax-applications-google-hashbang-and-state-maintenance/</link>
		<comments>http://morden.dk/2012/deeplinking-and-indexing-ajax-applications-google-hashbang-and-state-maintenance/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 21:32:06 +0000</pubDate>
		<dc:creator>moe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://morden.dk/?p=319</guid>
		<description><![CDATA[In AJAX applications user interaction is handled on the fly and content is generated and injected into the DOM. Today this is an important step in creating responsive UI&#8217;s and the benefits are obvious. But since users are no loner &#8230; <a href="http://morden.dk/2012/deeplinking-and-indexing-ajax-applications-google-hashbang-and-state-maintenance/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In AJAX applications user interaction is handled on the fly and content is generated and injected into the DOM. Today this is an important step in creating responsive UI&#8217;s and the benefits are <a title="AJAX app demo" href="http://maccman.github.com/spine.todos/" target="_blank">obvious</a>.</p>
<p>But since users are no loner browsing actual pages, you need to take extra steps to maintain state, handle url&#8217;s and serve indexable content to the crawlers. This post should give you a head start on your next fully fledged AJAX application.</p>
<h3>State and bookmarkable url&#8217;s</h3>
<p>Basically we wanna accomblish two things here:</p>
<ol>
<li>Be able to change the browser&#8217;s current url without causing roundtrips to the server.</li>
<li>Route those url&#8217;s to JavaScript functionality and dynamic content.</li>
</ol>
<p>&nbsp;</p>
<p>In modern browsers <a href="https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history" target="_blank"><code>history.pushState()</code></a> gives you full control, allowing you to manage history and change urls strictly on the client &#8211; this can be any valid url within the current domain. The <a href="https://developer.mozilla.org/en/DOM/window.onpopstate" target="_blank"><code>onpopstate</code></a> event will then let you listen for url changes and map relevant content and functionality.</p>
<p>Usually though you need to support a few more browsers and are stuck with <a href="https://developer.mozilla.org/en/DOM/window.location" target="_blank"><code>location.hash</code></a> and the <a href="https://developer.mozilla.org/en/DOM/window.onhashchange" target="_blank"><code>onhashchange</code></a> event which has wider support. The concept here is to use the hashfragment of the document (which does not cause roundtrips) to emulate url structures and/or parameters.</p>
<p>This could look something like this:<br />
<code>site.com/search.aspx#?term=foo&amp;filter=bar</code></p>
<p>Or this perhaps prettier one:<br />
<code>site.com/search.aspx#/foo/bar/or/what/ever</code></p>
<p>As long as it&#8217;s a valid url it can take whatever form you fancy, and if you include a plugin like Ben Almans <a title="Hashchange Plugin" href="http://benalman.com/projects/jquery-hashchange-plugin/" target="_blank">jQuery Hashchange</a>, this approach will have you going in IE6 and IE7 too.</p>
<p>From here on out, it&#8217;s about updating <code>location.hash</code> while listening for changes with <code>onhashchange</code>, then execute functionality accordingly. In other words you&#8217;re now linking to specific parts of the application and allowing users to bookmark relevant url&#8217;s.</p>
<h3>Abstracting url handling</h3>
<p>While very possible to do manually, this url-to-functionality mapping can get quite tedious. Fortunately there are quite a few libraries to help you abstract this part. Ben Almans extended <a title="jQuery BBQ Plugin" href="http://benalman.com/code/projects/jquery-bbq/docs/files/jquery-ba-bbq-js.html" target="_blank">BBQ plugin</a> is taking the hashchange a step further, adding <code>jQuery.param</code> and <code>jQuery.deparam</code> methods to help <a href="http://benalman.com/code/projects/jquery-bbq/examples/deparam/" target="_blank">querying url&#8217;s</a>.</p>
<p>A few other examples: <a href="http://benalman.com/code/projects/jquery-bbq/examples/fragment-basic/" target="_blank">Basic</a>, <a href="http://benalman.com/code/projects/jquery-bbq/examples/fragment-advanced/" target="_blank">Advanced</a>.</p>
<p>Also more elaborate frameworks like <a href="http://documentcloud.github.com/backbone/" target="_blank">Backbone.js</a> and the lighter <a href="http://spinejs.com/" target="_blank">Spine.js</a> has Route modules for mapping functionality. These also give the advantage of supporting <code>history.pushState()</code> while falling back on <code>location.hash</code> in older browsers &#8211; sounds like a win-win.</p>
<p>Here&#8217;s an example of routes in Backbone.js</p>
<pre class="js">var Workspace = Backbone.Router.extend({
  routes: {
    "help":                 "help",    // #help
    "search/:query":        "search",  // #search/kiwis
    "search/:query/p:page": "search"   // #search/kiwis/p7
  },
  help: function() {
    ...
  },
  search: function(query, page) {
    ...
  }
});</pre>
<p>&nbsp;</p>
<h3>Indexing content with Googles Hashbang</h3>
<p>Now that your about to turn your AJAX application up to 11, you need some way to dish out content to search engines to complete the scenario. If you&#8217;re able to go with the modern approach of changing proper url&#8217;s with <code>pushState()</code>, you just have to make sure that the server is able to render relevant content based on the same url&#8217;s &#8211; which might include some useragent detection skills.</p>
<p>When it comes to the hashfragment things get a bit more complicated, as it&#8217;s not a part of the communication with the server. Google is aware of that and offers a solution with the <a href="http://code.google.com/intl/da-DK/web/ajaxcrawling/docs/getting-started.html">hashbang notation</a> &#8211; &#8216;#!&#8217;. With this you&#8217;re letting Google know that this &#8216;ajax-url&#8217; is indexable and that the server is able to render a snapshot of the html. The crawler will then make one additional request using the hashfragment as a parameter.</p>
<p>Using one of the previous examples, this is what happens:<br />
<code>site.com/search.aspx#!/foo/bar/or/what/ever</code></p>
<p>Will result in this additional request:<br />
<code>site.com/search.aspx?_escaped_fragment_=/foo/bar/or/what/ever</code></p>
<p>The server then has to process this request and render a snapshot of the relevant content.</p>
<p>Basically thats it, you now have hashbang url&#8217;s in the Google index linking directly to your AJAX functionality.</p>
<h3>Using redirects</h3>
<p>You can use redirects to help with the server part, it can sometimes make things easier. As long as the crawler eventually ends up at a page, it&#8217;s perfectly safe to do redirections.</p>
<p>Lets say the crawler requests:<br />
<code>site.com?_escaped_fragment_=/foo/bar</code></p>
<p>You could redirect to this relevant content:<br />
<code>site.com/foo/bar</code></p>
<p>Also if you&#8217;re using a framework like Backbone.js with <code>pushState()</code> for modern browser and <code>location.hash</code> as fallback for older ones, redirects will complete the cycle.</p>
<p>The modern browser gets a <code>pushState()</code> for AJAX functionality on:<br />
<code>site.com/foo/bar</code></p>
<p>The older browser gets a hashchange for AJAX functionality on:<br />
<code>site.com#!/foo/bar</code></p>
<p>The server redirects the crawlers additional request from:<br />
<code>site.com?_escaped_fragment_=/foo/bar</code></p>
<p>To this:<br />
<code>site.com/foo/bar</code></p>
<h3>So 301&#8242;s or 302&#8242;s?</h3>
<p>Using 301 &#8216;Moved permanently&#8217; redirects, the target url will end up in the Google index, if you use 302 &#8216;Moved temporarily&#8217; it will be the #! url.</p>
<p>Usually 302&#8242;s straight to the AJAX experience is the way to go, but remember that disabled users, or users with JavaScript turned off, could hit that url too.</p>
<p>Here&#8217;s the <a href="http://code.google.com/intl/da-DK/web/ajaxcrawling/" target="_blank">official info on Google&#8217;s AJAX crawling</a>, there&#8217;s som e good info on creating HTML snapshots as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://morden.dk/2012/deeplinking-and-indexing-ajax-applications-google-hashbang-and-state-maintenance/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML5 Presentation</title>
		<link>http://morden.dk/2011/html5-presentation/</link>
		<comments>http://morden.dk/2011/html5-presentation/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 14:05:51 +0000</pubDate>
		<dc:creator>moe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[Slides]]></category>

		<guid isPermaLink="false">http://morden.dk/?p=308</guid>
		<description><![CDATA[HTML5rocks.com &#8211; a great site btw &#8211; has some good slides showing the features of modern browsers. Originally created by Marcin Wichary and modified by many people in the Google Chrome team. Use them whenever you need to spread the &#8230; <a href="http://morden.dk/2011/html5-presentation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.html5rocks.com">HTML5rocks.com</a> &#8211; a great site btw &#8211; has some good slides showing the features of modern browsers.</p>
<p>Originally created by Marcin Wichary and modified by many people in the Google Chrome team. Use them whenever you need to spread the word of HTML5 awesomeness to techies, clients, suits and other decision makers!</p>
<p><a href="http://slides.html5rocks.com"><strong>slides.html5rocks.com</strong></a><br/> (Launch it in Chrome if you want all the demos to run)</p>
]]></content:encoded>
			<wfw:commentRss>http://morden.dk/2011/html5-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Frontend Development Feeds and Newsletters</title>
		<link>http://morden.dk/2011/frontend-development-feeds-and-newsletters/</link>
		<comments>http://morden.dk/2011/frontend-development-feeds-and-newsletters/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 19:29:05 +0000</pubDate>
		<dc:creator>moe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Feeds]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Newsletters]]></category>

		<guid isPermaLink="false">http://morden.dk/?p=275</guid>
		<description><![CDATA[Hey folks, here&#8217;s a list of feeds and newsletters you might find useful &#8211; I know I do. They&#8217;re mostly personal blogs by dedicated Javascript developers, and the newsletters have kept an excellent standard so far. So in no particular &#8230; <a href="http://morden.dk/2011/frontend-development-feeds-and-newsletters/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hey folks, here&#8217;s a list of feeds and newsletters you might find useful &#8211; I know I do. They&#8217;re mostly personal blogs by dedicated Javascript developers, and the newsletters have kept an excellent standard so far.<br />
So in no particular order.</p>
<h3>Feeds</h3>
<ul>
<li><a href="http://feeds2.feedburner.com/LearningJquery" target="_blank">feedburner.com/LearningJquery</a></li>
<li><a href="http://feeds.feedburner.com/BrandonAaron" target="_blank">feedburner.com/BrandonAaron</a></li>
<li><a href="http://alexsexton.com/?feed=rss2" target="_blank">alexsexton.com/?feed=rss2</a></li>
<li><a href="http://weblog.bocoup.com/" target="_blank">weblog.bocoup.com</a></li>
<li><a href="http://paulirish.com/feed/" target="_blank">paulirish.com/feed</a></li>
<li><a href="http://services.social.microsoft.com/feeds/feed/query/tag/scriptjunkieLearn/eq/ns/DiscoveryFeedTool/eq/and" target="_blank">microsoft.com/feeds/scriptjunkieLearn</a></li>
<li><a href="http://feeds.benalman.com/benalman/" target="_blank">feeds.benalman.com/benalman</a></li>
<li><a href="http://dustindiaz.com/" target="_blank">dustindiaz.com</a></li>
<li><a href="http://www.alistapart.com/articles/" target="_blank">alistapart.com/articles</a></li>
<li><a href="http://jszen.blogspot.com/feeds/posts/default" target="_blank">jszen.blogspot.com/feeds</a></li>
<li><a href="http://www.phpied.com/" target="_blank">phpied.com</a></li>
<li><a href="http://blog.getify.com/feed/" target="_blank">blog.getify.com/feed</a></li>
<li><a href="http://tagneto.blogspot.com/feeds/posts/default?alt=rss" target="_blank">tagneto.blogspot.com/feeds</a></li>
<li><a href="http://feeds.yuiblog.com/YahooUserInterfaceBlog" target="_blank">yuiblog.com/YahooUserInterfaceBlog</a></li>
<li><a href="http://feeds.feedburner.com/yayQuery" target="_blank">feedburner.com/yayQuery</a></li>
<li><a href="http://blog.jquery.com/" target="_blank">blog.jquery.com</a></li>
<li><a href="http://perfectionkills.com/" target="_blank">perfectionkills.com</a></li>
<li><a href="http://www.stevesouders.com/blog/feed/" target="_blank">stevesouders.com/blog/feed</a></li>
<li><a href="http://feeds.feedburner.com/adequatelygood" target="_blank">feedburner.com/adequatelygood</a></li>
<li><a href="http://css-tricks.com/" target="_blank">css-tricks.com</a></li>
<li><a href="http://feeds.feedburner.com/JsconfLive" target="_blank">feedburner.com/JsconfLive</a></li>
<li><a href="http://feeds.feedburner.com/VigetInspire" target="_blank">feedburner.com/VigetInspire</a></li>
<li><a href="http://feeds.feedburner.com/JupiterMain" target="_blank">feedburner.com/JupiterMain</a></li>
<li><a href="http://feeds.feedburner.com/badassjs" target="_blank">feedburner.com/badassjs</a></li>
<li><a href="http://feeds.feedburner.com/JohnResig" target="_blank">feedburner.com/JohnResig</a></li>
<li><a href="http://feeds.feedburner.com/reybango/zSyW" target="_blank">feedburner.com/reybango/zSyW</a></li>
<li><a href="http://addyosmani.com/blog/feed/" target="_blank">addyosmani.com/blog/feed</a></li>
<li><a href="http://ajaxian.com/" target="_blank">ajaxian.com</a></li>
<li><a href="http://feeds.feedburner.com/chrisheilmann" target="_blank">feedburner.com/chrisheilmann</a></li>
<li><a href="http://www.erichynds.com/feed/" target="_blank">erichynds.com/feed</a></li>
<li><a href="http://allyoucanleet.com/feed/" target="_blank">allyoucanleet.com/feed</a></li>
<li><a href="http://danheberden.com/feed/" target="_blank">danheberden.com/feed</a></li>
<li><a href="http://www.danwebb.net/feed/atom.xml" target="_blank">danwebb.net/feed/atom.xml</a></li>
<li><a href="http://feeds.feedburner.com/webdevnet" target="_blank">feedburner.com/webdevnet</a></li>
</ul>
<p><br/></p>
<h3>Newsletters</h3>
<ul>
<li><a href="http://javascriptweekly.com/" target="_blank">javascriptweekly.com</a></li>
<li><a href="http://html5weekly.com/" target="_blank">html5weekly.com</a></li>
<li><a href="http://dartweekly.com/" target="_blank">dartweekly.com</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://morden.dk/2011/frontend-development-feeds-and-newsletters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s the Business Value of a Rounded Corner?</title>
		<link>http://morden.dk/2011/whats-the-business-value-of-a-rounded-corner/</link>
		<comments>http://morden.dk/2011/whats-the-business-value-of-a-rounded-corner/#comments</comments>
		<pubDate>Thu, 19 May 2011 13:29:39 +0000</pubDate>
		<dc:creator>moe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Browserstats]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://morden.dk/?p=269</guid>
		<description><![CDATA[This is a dive into the challenges of visual identity, browser compatibility and embracing the web. It&#8217;s up on the blog where i work, so sorry guys, this one is in Danish. blog.vertica.dk/post/Hvad-er-forretningsvc3a6rdien-af-et-rundt-hjc3b8rne.aspx]]></description>
			<content:encoded><![CDATA[<p>This is a dive into the challenges of visual identity, browser compatibility and embracing the web. It&#8217;s up on the blog where i work, so sorry guys, this one is in Danish.</p>
<p><a href="http://blog.vertica.dk/2011/05/19/hvad-er-forretningsvaerdien-af-et-rundt-hjorne/">blog.vertica.dk/post/Hvad-er-forretningsvc3a6rdien-af-et-rundt-hjc3b8rne.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://morden.dk/2011/whats-the-business-value-of-a-rounded-corner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Animate and the Step Callback</title>
		<link>http://morden.dk/2011/jquery-animate-and-the-step-callback/</link>
		<comments>http://morden.dk/2011/jquery-animate-and-the-step-callback/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 12:44:37 +0000</pubDate>
		<dc:creator>moe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://morden.dk/?p=217</guid>
		<description><![CDATA[Hey, this is turning into a jQuery blog! Believe it or not I really do other types of development too. It&#8217;s been a while though and this post is a quick share of something that has not seen a lot &#8230; <a href="http://morden.dk/2011/jquery-animate-and-the-step-callback/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hey, this is turning into a jQuery blog! Believe it or not I really do other types of development too. It&#8217;s been a while though and this post is a quick share of something that has not seen a lot of coverage, hope it comes in handy.</p>
<p>So that library <a href="http://api.jquery.com">jQuery</a> has that <a href="http://api.jquery.com/animate/"><code>.animate()</code></a> method, that has them options, with one being the step callback &#8211; looking like this.</p>
<pre class="js">
$( 'span' ).animate({
	// Properties of the elements to animate
	opacity: 0.25,
	left: '+=50'
},
{
	// step is a callback for each step of the animation
	step: function( now, fx ) {
		// do stuff...
	}
});
</pre>
<p>Nothing new, nothing fancy, but if you look at the two arguments being applied, things start to get kinda interesting. Especially when the latter being the jQuery.fx prototype object, you suddenly have a load of properties to utilize &#8211; one of them being the fx.pos. This is a modulus 1 kinda value that sweeps from 0 to 1 through the duration of the animation, allowing you to animate other stuff that can be calculated using that factor. </p>
<p>There&#8217;s probably not a lot of use cases for the next example, but it shows the callback and arguments in use in a simple way &#8211; click result to see the animation.</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/mordendk/hLXTw/embedded/js,result/"></iframe></p>
<p>Note that both <code>this</code> and <code>fx.elem</code> is a reference to the element currently being animated.</p>
<p>A more useful scenario is one where I had to do a quick poll type functionality for a project. After vote was given, I wanted the polling result to animate and count to the resulting score. All I had to do was to multiply it by <code>fx.pos</code>.</p>
<pre class="js">
// Calculate score by multiplying by fx.pos that sweeps from 0.0 to 1.0.
step: function( now, fx ) {
	$span.text( Math.floor( fx.pos * score ) + '%' );
}
</pre>
<p>Here&#8217; a simple version of how it turned out &#8211; submit your answer.</p>
<p><iframe style="width: 100%; height: 150px" src="http://jsfiddle.net/mordendk/RcEcH/show/"></iframe></p>
<p>And here&#8217;s a link to the <a href="http://jsfiddle.net/mordendk/RcEcH/">full fiddle</a>. </p>
<p>Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://morden.dk/2011/jquery-animate-and-the-step-callback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handy jQuery Plugin for Aligning Height</title>
		<link>http://morden.dk/2011/handy-jquery-plugin-for-aligning-height/</link>
		<comments>http://morden.dk/2011/handy-jquery-plugin-for-aligning-height/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 21:50:20 +0000</pubDate>
		<dc:creator>moe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://morden.dk/?p=148</guid>
		<description><![CDATA[Update: Folks over at css-tricks.com have a simpler solution, so I&#8217;m gonna throw in the towel on this one. Apparently if you set the height on the elements as you go, you can just check for the top position to &#8230; <a href="http://morden.dk/2011/handy-jquery-plugin-for-aligning-height/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Update: </strong> Folks over at <a href="http://css-tricks.com/">css-tricks.com</a> have a <a href="http://css-tricks.com/equal-height-blocks-in-rows/">simpler solution</a>, so I&#8217;m gonna throw in the towel on this one. Apparently if you set the height on the elements as you go, you can just check for the top position to see which element goes with which row. </p>
<p>Guess I should have thought of that :|</p>
<p>Yeah I know, just what the world needs, another jQuery plugin. Still it&#8217;s more flexible and handles more scenarios than others I&#8217;ve come across, so I guess it deserves a little write-up.</p>
<p>I recently worked on a dashbord-style interface for a client and needed to handle various widgets in a flexible grid. Actually more than a grid it would be endless combinations of different sized widgets as users began to customize the page &#8211; one could end up looking something like this:</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/mordendk/EQzPH/show/" frameborder="0"></iframe></p>
<p>Now this is easily done in CSS by floating containers of various sizes:</p>
<pre class="css">
.col, .col_100, .col_75, .col_50, .col_33, .col_25
{
    float:left;
    margin:0 0 15px 15px;
    padding:10px;
    width:465px;
}
.col_75 { width:340px; }
.col_50 { width:215px; }
.col_33 { width:131px; }
.col_25 { width:90px; }
</pre>
<p>However, as the content of each individual container grows, the rows are no longer aligned and the floats start cluttering up:</p>
<p><iframe style="width: 100%; height: 450px" src="http://jsfiddle.net/mordendk/EQzPH/1/show/" frameborder="0"></iframe></p>
<p>Indeed not teh roxXor and one way to handle it is to clear the floats every time there&#8217;s a full row. Depending on the design that may do just fine. </p>
<p>Another way is to use a piece of JavaScript to set the height of each container, to that of the max height within a given row. When working with heavy styled containers as in the above example, that is usually the best way to go. </p>
<p>So including the Align Height Plugin to do just that, we end up with a flexible solution that works:</p>
<p><iframe style="width: 100%; height: 550px" src="http://jsfiddle.net/mordendk/EQzPH/3/embedded/result,js/" frameborder="0"></iframe></p>
<p>When the DOM is ready you assign the plugin to the relevant containers, in this case that would be all divs with a class that begins with col..</p>
<pre class="js">
$( document ).ready( function(){
	$( '#page > div[class^="col"]' ).alignHeight();
} );
</pre>
<p>The plugin goes through all the elements, calculate rows and align the height accordingly. To do that it needs to know what percentage of a rows total width the element corresponds to. These values are paired in the sizes object and defaults to :</p>
<pre class="js">
// className : value
sizes: {
	'col' : 100,
	'col_25' : 25,
	'col_33' : 33.33,
	'col_50' : 50,
	'col_75' : 75,
	'col_100' : 100
}
</pre>
<p>But when applying the plugin you can easily map your own like this:</p>
<pre class="js">
$( document ).ready( function(){
	$( '#page > div[class^="col"]' ).alignHeight( { 'col_news' : 75, 'col_feed' : 25 } );
} );
</pre>
<p>So go have a look at <a href="http://www.jsfiddle.net/mordendk/EQzPH/3/">the full fiddle</a> or head on over to <a href="https://github.com/mordendk/jQuery-Plugins">GitHub</a> and download the plugin:</p>
<p><a href="https://github.com/mordendk/jQuery-Plugins/raw/master/jquery.alignheight.js">jquery.alignheight.js</a> ( 3.3kb )<br />
<a href="https://github.com/mordendk/jQuery-Plugins/raw/master/jquery.alignheight.min.js">jquery.alignheight.min.js</a> ( 1.6kb minified with JSMin ). </p>
]]></content:encoded>
			<wfw:commentRss>http://morden.dk/2011/handy-jquery-plugin-for-aligning-height/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
