tags:

views:

122

answers:

1

I'm wondering about HTML reuse when using Ajax (specifically Dojo). So let me set the context:

Context

Say I have index.html with some *.js included files at http://host/site/ that consumes some REST service say http://host/rest/xxxx/yy

The user interacts with http://host/site/{index.html} and everybody is happy.

I'm pondering what happens when the user goes to http://host/site/contacts or http://host/site/contacts/active using different technologies. (Client state/bookmarks)

For example in PHP one can use Smarty (to replace tags in a template html file) and probably use mod_rewrite to clean up the url from say http://host/site.php/contacts to http://host/site/contacts and http://host/rest.php/xxxx/yy to http://host/rest/xxxx/yy. Thus using the URL for state/bookmarks. That's "relatively easy" since we'll re-use template.html and generate/include js code as needed in the PHP code.

With RoR you have a nice server doing the job for you and I guess it is a similar approach as above. (It seems since I do no know Ruby or RoR.)

So to get to the real question.

Question

Allowing the user to hit/bookmark the following RESTful-like resources in the app:

For the client (application state) one can thus design /site.html (purely client side) OR /site.php (server side + code generation/includes etc.)

What would be a good way to approach this with a one page web app:

Any thoughts on this or some good approaches?

A: 
Eugene Lazutkin
Derick
Could you clarify what points are #1 and #2?
Eugene Lazutkin
Derick
Done. (Here goes the filler --- apparently the answer cannot be shorter than 15 characters. Why???)
Eugene Lazutkin
I'll accept your answer just because it beautifully expanded and answers my question about 80%
Derick