URL链接后面的参数解析,与decode编码解码;页面刷新回到顶部jquery

function request() {
    var urlStr = location.search;
    if (urlStr.indexOf("?") == -1) {
        theRequest = [];
        return;
    }
    urlStr = urlStr.substring(1);
    var strs = urlStr.split("&");
    for (var i = 0; i < strs.length; i++) {
        theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[0]);
        theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
    }
}

URL链接后面的参数解析,与decode编码解码

页面刷新回到顶部jquery

$('html,body').animate({scrollTop: '0px'}, 800);