3 つのリンクがあり、2 つにはプッシュステート データがあり、1 つにはありません。ユーザーとタグのリンクにはデータがありますが、トピックにはありません。ユーザーをクリックしてからトピックに戻るか、タグをクリックしてからトピックに戻ると、完璧に機能します。ユーザーをクリックしてからタグをクリックして戻ると、最後のプッシュステート (タグ) のみが読み込まれます。タグをクリックしてユーザーが戻ると、ユーザーのプッシュステートが再利用されます。タグ -> ユーザー -> トピックに移動すると、ユーザーに戻り、ユーザーにも戻りますか??
$('#changetousers').click(function () {
$('#loadingAjaxs').show(); $('#flubestext').hide();
$('#contentwrap').load('@Url.Action("FollowingUsersDetail", "Following", new {@ajax = "yes"})', function () { $('#loadingAjaxs').hide(); $('#flubestext').show(); window.history.pushState({ "page": "followingusers" }, 'title1', '/users/'); window.onpopstate = function (e) { document.getElementById('changetousers').click(); };
})
});
$('#changetotags').click(function () {
$('#loadingAjaxs').show(); $('#flubestext').hide();
$('#contentwrap').load('@Url.Action("FollowingTagsDetail", "Following", new {@ajax = "yes"})', function () { $('#loadingAjaxs').hide(); $('#flubestext').show(); window.history.pushState({ "page": "followingtags" }, 'title2', '/tags/'); window.onpopstate = function (e) { document.getElementById('changetotags').click(); }; })
});
$('#changetofavorites').click(function () {
$('#loadingAjaxs').show(); $('#flubestext').hide();
$('#contentwrap').load('@Url.Action("FollowingTopicsDetail", "Following", new {@ajax = "yes"})', function () { $('#loadingAjaxs').hide(); $('#flubestext').show(); window.history.pushState(null, 'title', '/favorites/'); })
});