I built this website using ajax (via jquery) instead of full page refresh. Right now, it does not support the browser’s back/next buttons, nor deeplink bookmarking.
I’d like to implement these functionalities, using for instance the jquery bbq plugin but i’m not sure i understand completely the concept.
The main point i’m missing is this: do i need to modify all my links?
For instance, take this url:
http://example.com/projects/title-of-project/visuals/video/
My application converts the url into these vars:
section = projects
item= title-of-project
content=visuals
id=video
The php script detects whether this is an ajax call (thus only returns the video html) or a non ajax call (thus returns the full page html, with the video code inside).
If i use hashes instead, the browser will not send the variables. right?
I’m a bit lost so don’t hesitate to comment if you need more details.
Basically, hash-permalinks work like this:
For example, let’s say a link on your site uses AJAX to load content from
http://example.com/some/path. When the user clicks the link, the browser URL could behttp://yoursite.com/#some/path. When another link is clicked, the hash could change to#some/other/path. When the user hits the back button, the hash should be returned to#some/path. Your app would then take the current hash and then use AJAX to loadhttp://example.com/some/pathaccordingly.So, the URLs that AJAX grabs content from don’t have to change. Does that make sense? I may have misunderstood your question.