Chrome在按下按钮时显示ajax响应 [英] Chrome displays ajax response when pressing back button

查看:103
本文介绍了Chrome在按下按钮时显示ajax响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个问题,如果我使用jQuery的Get方法来获取某些内容,如果我点击回来,而不是实际返回历史中的一页,它就会显示Ajax查询返回的内容。

I've come across a problem that if I use jQuery's Get method to get some content, if I click back, instead of it actually going back one page in the history, it instead shows the content returned by the Ajax query.

任何想法的?

http://www.dameallans.co.uk/preview/allanian-society/news/56/Allanian-test

在上面的页面中,如果您在更改页面后点击返回的注释列表下方使用分页,它会显示用于生成

On the above page, if you use the pagination below the list of comments you will notice when clicking back after changing a page, that it shows the HTML content used to generate the list of comments.

我注意到它并不总是这样做,但如果您点击不同的页面几次并单击后退按钮,它只是简单的在窗口中显示json文本而不是网站。

I've noticed it doesn't always do it, but if you click on a different page a few times and click the back button, it simply displays json text within the window instead of the website.

出于某种原因,这只会影响Chrome,因为IE和Firefox可以正常工作。

For some reason, this is only affecting Chrome as IE and Firefox work ok.

推荐答案

确保您的AJAX请求使用完整HTML文档中的其他网址。 Chrome浏览器会缓存最近的请求,即使它只是一个部分。

Make sure your AJAX requests use a different URL from the full HTML documents. Chrome caches the most recent request even if it is just a partial.

https://code.google.com/p/chromium/issues/detail?id=108425

这篇关于Chrome在按下按钮时显示ajax响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆