最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Working of browser 'back button' using jquery ajax and PHP - Stack Overflow

programmeradmin3浏览0评论


I am working on an application which involves lot of ajax requests for updating the HTML content.I have a dashboard with a fix left menu or accordian panel which takes the event and based on the events I have to update the center portion of the page using ajax.
Issue: I am facing issue with the back button of the browser as I am not refreshing the page.I want that the user should be able to navigate back and forth through the ajax content,but as I don't change the URL it redirects the user to the previous page they came from and destroys all the information entered by the user in the fields.
While making a search I came through this website which is quite popular and manages a playlist on the left and a player at the bottom without refreshing the page,but the URL changes for different content the show.
I am not sure if there is any specific framework that can be used or it can be achieved via normal code.
Any help in pointing me to the right links or suggestions over it would be helpful.
Thank you


I am working on an application which involves lot of ajax requests for updating the HTML content.I have a dashboard with a fix left menu or accordian panel which takes the event and based on the events I have to update the center portion of the page using ajax.
Issue: I am facing issue with the back button of the browser as I am not refreshing the page.I want that the user should be able to navigate back and forth through the ajax content,but as I don't change the URL it redirects the user to the previous page they came from and destroys all the information entered by the user in the fields.
While making a search I came through this website which is quite popular and manages a playlist on the left and a player at the bottom without refreshing the page,but the URL changes for different content the show.
I am not sure if there is any specific framework that can be used or it can be achieved via normal code.
Any help in pointing me to the right links or suggestions over it would be helpful.
Thank you

Share Improve this question asked Jun 20, 2013 at 9:26 coderunnercoderunner 9351 gold badge18 silver badges33 bronze badges 3
  • There has to be one, because gmail uses it. – DevZer0 Commented Jun 20, 2013 at 9:28
  • stackoverflow./questions/29886/… – DevZer0 Commented Jun 20, 2013 at 9:29
  • Yes,but not sure about the exac implementation and integration with PHP! :P – coderunner Commented Jun 20, 2013 at 9:30
Add a ment  | 

1 Answer 1

Reset to default 5

What you seem to want is history.js. It uses the HTML5 history API to navigate (and you can fire events upon change), and it also supports older browsers by using hashbangs.

Essentially the browser will not load any new page, but you can still change the URL to reflect changes (and have the users bookmark pages etc.).

Take a look at their demos to see if it's what you're looking for.

发布评论

评论列表(0)

  1. 暂无评论