[Dancer-users] URI design question

Naveed Massjouni naveedm9 at gmail.com
Wed May 25 07:57:20 CEST 2011


On Tue, May 24, 2011 at 10:50 PM, Mr. Puneet Kishor <punk.kish at gmail.com> wrote:
> Not really a Dancer-question per se, but you all are really, really smart, hence...
>
> So, I've taken this whole REST thing to heart. My approach is that the web application itself is a client now, just like a command-line program might be a client, to the data store. So, when the web page loads, even the very first time, it is like an empty form. On load, an ajax query is fired to GET the records that are then filled in. Consider a simple books catalog (make believe app).
>
> 1. User goes to [http://myapp.com]
>
> 2. A web page loads. It has all the "chrome" (the logos, buttons, etc.), but no books. On load, a call is made to [http://myapp.com/books] which sends back a JSON object with all the books, and the web page comes alive. Except, the address bar in the browser still says [http://myapp.com]. Ok. no matter.
>
> 3. The books are tagged. So, the user clicks on one of the tags, say "Thrillers," and an ajax query is fired to [http://myapp.com/books/tag/thrillers]. Once again, the correct data are received and the web page is filled in with the results. Except, the address bar in the browser still says [http://myapp.com].
>
> You get the idea. Since all interaction is via ajax, the browser never refreshes completely. So, the user has no visual indication as to where (s)he is on the web site. Which also leads to a problem -- there is no way to send a link to anyone.
>
> In other words, is it possible to change the address in the browser without refreshing the browser? Any other thoughts on such an application design?

If you want to be really cool, you can implement the neat effect that
for example github uses to traverse the source code hierarchy. When
you click on a folder, the source code listing is updated, the url is
updated, but there is no page reload happening.

You can see a demo here:
https://github.com/blog/760-the-tree-slider

And here is some more info:
http://diveintohtml5.org/history.html
https://github.com/defunkt/jquery-pjax/

-Naveed

>
> Puneet.
>
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>


More information about the Dancer-users mailing list