我的代码在具有 iframe 更改的页面中不起作用 (document.cookie)
!回发后!代码是:
$(window).scroll(function() {
oldScroll = $(this).scrollTop();
if (oldScroll >15) {
document.cookie = pathname + oldScroll+'@'; }
});
$(window).load(function() {
load();
});
function load() {
var pathname = window.location.pathname;var newScroll;
var starPos = document.cookie.indexOf('aspx')+4;
var endPos = document.cookie.indexOf('@');
newScroll = document.cookie.search(";");
var oldPage=document.cookie.substring(0,pathname.length);
$(window).scrollTop(document.cookie.substring(starPos, endPos));
}