How to keep the browser history in sync when using Ajax?

后端 未结 8 1763
無奈伤痛
無奈伤痛 2020-11-29 07:48

I\'m writing a simple photo album app using ASP.NET Ajax.
The app uses async Ajax calls to pre-load the next photo in the album, without changing the URL in the browser.

8条回答
  •  情深已故
    2020-11-29 08:26

    Many websites make use of a hidden iframe to do this, simply refresh the iframe with the new URL, which adds it to the browsing history. Then all you have to do is handle how your application reacts to those 'back button' events - you'll either need to detect the state/location of the iframe, or refresh the page using that URL.

提交回复
热议问题