跳转过程前手动存取当前页面信息

$(function(){
var aList = document.querySelectorAll("a");
for (var i=0;i<aList.length;i++) {
aEvent(i)
}

function aEvent(i){
$(aList[i]).click(function(){
window.localStorage.Referer=document.URL.split("/www/wap/")[1];
})
}
})

新页面ajax 手动设置

...

params.beforeSend = function(request) {
request.setRequestHeader("From", "App");
// console.log(window.localStorage.Referer);
request.setRequestHeader("Lysource", window.localStorage.Referer);

...

 百度统计

var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?f9f63abe1b3f7c5882ca575ed9fa85e3";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();

posted on 2017-02-17 14:01  田潇  阅读(1419)  评论(0编辑  收藏  举报