/*-->>htmlRoute*/ function htmlRoute_forward(_url){ if(!sessionStorage.htmlRoute){ sessionStorage.htmlRoute = location.pathname+"$"+_url; }else{ sessionStorage.htmlRoute=sessionStorage.htmlRoute+"$"+_url; } window.location.href = _url; } function htmlRoute_backward(i){//1就是上一步,2上二步。。 if(i==undefined){ i=1; } var arr = sessionStorage.htmlRoute.split("$"); var prevStep = arr[arr.length-(i+1)]; htmlRoute_backTo(prevStep); } function htmlRoute_backTo(jumpTarget){ console.log(jumpTarget); sessionStorage.htmlRoute=sessionStorage.htmlRoute.substr(0,sessionStorage.htmlRoute.indexOf(jumpTarget)+jumpTarget.length); window.location.href = jumpTarget; } function htmlRoute_prev(){ return sessionStorage.htmlRoute.substr(0,sessionStorage.htmlRoute.indexOf(location.pathname)-1); } /*--<<htmlRoute*/
js多页面返回,url封装
猜你喜欢
转载自1971161579.iteye.com/blog/2378239
今日推荐
周排行