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:
- Parsing window.location to determine the state/bookmark as per this link?
- Or does one not approach it like this? One needs server side "help"
- Should I opt for http://host/site#contacts/active? I prefer http://host/site/contacts/active
Any thoughts on this or some good approaches?