I’m starting to write new application and want to make it full ajax style 🙂
I’m using Jquery to make ajax requests.
Main JS file gets some variable from pressed link and according to that link goes to some php files grabs some data comes back and puts everything in pre prepared html tags.
This is the way I see this app.
Now I’ve found some solutions to make back&forward buttons start working but in those solutions their script goes to predefined pages and reads some data according to some constant ID So I don’t like it.
What I want is…
- I need some code which will prevent browser from page reloading if user is pressing back,forward button
- Remember browser position, so If we are on state ‘C’ and back was pressed it brings to JS some variable with value ‘B’, then JS goes to php and says ‘B’ so php will understand which content to prepare. gives content back to JS , JS updates the page, everybody happy.
Is there solution which will work this way ?
I’ve used jQuery BBQ: Back Button & Query Library in the past for just this purpose.
Specifically, the basic AJAX example looks to be what you’re after. The rest of the examples are most excellent as well.