<story><title>Why JavaScript web applications should embrace traditional URLs</title><url>http://9elements.com/io/index.php/hybrid-javascript-apps/</url></story><parent_chain></parent_chain><comment><author>jashkenas</author><text>The fundamental problem with attempting to transparently support querystrings on the client-side -- touched on a bit in this article, but not explained completely, is this:&lt;p&gt;Querystrings are a server-side convention for URLs containing parameters -- the browser doesn&amp;#x27;t traditionally parse them. If you ask for document.location.search, you&amp;#x27;ll get back an opaque string containing the query part that you&amp;#x27;ll have to parse yourself.&lt;p&gt;The point of Backbone&amp;#x27;s router is to be able to transparently support both pushState-based routing, with real URLs, as well as onhashchange-based routing, for older browsers that can&amp;#x27;t do real URLs via JavaScript. So, if you add querystring generation and parsing support to Backbone&amp;#x27;s router (as some plugins do), and use pushState, everything starts off looking peachy. But as soon as you run into an older browser, and try to fall back to the hash-based URL equivalent, you run into trouble:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    &amp;#x2F;app?query=string#home?query=other
&lt;/code&gt;&lt;/pre&gt;
... now you have the possibility to have to merge two different sources of query string, and still keep transparent redirects working back and forth between the two schemes.&lt;p&gt;I&amp;#x27;d be more than happy to merge an implementation that supports them -- but that implementation needs to solve this particular problem, and have a relatively bulletproof way of supporting the querystring logic parsed out of real URLs and transferred to the fragment, and vice-versa ... and also has to have a strategy for dealing with URLs of the above breed. The devil, as always, is in the details.</text></comment>
<story><title>Why JavaScript web applications should embrace traditional URLs</title><url>http://9elements.com/io/index.php/hybrid-javascript-apps/</url></story><parent_chain></parent_chain><comment><author>VeejayRampay</author><text>This article about &amp;quot;Javascript web applications&amp;quot; quickly turns into an article about how Backbone&amp;#x27;s URL handling is bad. The content is really interesting but it feels kind of passive-aggressive.</text></comment>