Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Asana handle URLs without a #

You may have seen app.asana.com. If not you should check it out, it is a very nice designed webapp.

But I can't figure out how they handle the whole URL management. Backbone.js or Knockout.js handles the URL with the #, and everything after that is just generated.

But asana doesn't have a hash and can modify the URL, how are they doing this?

like image 355
tonlap Avatar asked Dec 21 '11 23:12

tonlap


2 Answers

Looks like they're using HTML5 history.pushState(); so they don't have to refresh the page and so they don't have to use # (hashes) in the URL to go to a certain part in a web app.

Here's a good tutorial about history.pushState();: https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history

This is the what Google+ and Facebook uses to change the URL without refreshing.

I hope this helps.

like image 194
Nathan Avatar answered Nov 07 '22 07:11

Nathan


HTML5 Push State: http://spoiledmilk.dk/blog/html5-changing-the-browser-url-without-refreshing-page

The big benefit here is that if you paste an Asana URL directly into the browser (or click on a link from an email), the server sees the full URL and can immediately send the appropriate task data to the client. We used to use url fragments, but we needed to do a second round trip after the application loaded to read the fragment in JavaScript and pass it to the server.

like image 39
Jackie Bavaro Avatar answered Nov 07 '22 06:11

Jackie Bavaro