大家好,我开发了一个谷歌地图应用程序,具有简洁的搜索功能 - 但是我注意到我想要像 facebook 人所做的那样,有一个指向由 生成的页面的硬链接(hard link) Ajax 查询。例如,您单击 facebook 中的链接,它会附加到当前网址,您可以复制粘贴新网址来获取请求的页面...我如何实现类似的东西...
最佳答案
听起来您想使用可用于重新访问当前状态页面的链接来更新浏览器的 URL。这可以通过操纵浏览器历史记录来完成。
一个好的解决方案是:
非常简单的历史
http://code.google.com/p/reallysimplehistory/
Really Simple History is a lightweight JavaScript library for the management of bookmarking and browser history in Ajax/DHTML applications. RSH serializes application data in an internal JavaScript cache so that bookmarks and the back button can be used to return your application to an earlier state.
看看这个优秀的例子:
http://www.justise.com/2009/01/26/enabling-the-back-button-in-ajax-applications/
关于php - Ajax 请求结果的 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2126501/