有什么办法来监听在URL hashchanges和AJAX记录事件中使用的后退按钮的等保存AJAX页面状态
使用链接像这样:
<a href="/#!page">Go to page!</a>
和脚本像这样的:
<script type="text/javascript">
$(function() {
if (window.location.hash){contentload(window.location.hash);}
$('a').click(function() {
fragment = this.hash;
contentload(fragment);
});
});
function contentload(fragment) {
fragment = fragment.slice(1).replace('!', '')
$('#content').load('http://mysite.com/'+fragment+'?ajax=1');
}
</script>
我需要尝试并保存网页的状态,我已经看到了jQuery address plugin但不知道如何实现这个..
退出在标题中写代码时,请解决。 – 2011-06-17 00:45:58
对不起,男人,从来没有意识到警察对我的要求 – Ricki 2011-06-17 00:52:50
没有必要。 – 2011-06-17 01:19:33