用history.replaceState可以实现不刷新给路由添加参数 var myhref = location.href ;//ajax外面定义一个变量装href; setTimeout(function(){ history.pushState('','',myhref +'?1111'); },5000); history.pushState(state, title, url);state:state对象,与要跳转到的URL对应的状态信息。title:名称。url:要跳转到的URL地址,不能跨域。
用history.replaceState可以实现不刷新给路由添加参数
history.pushState(state, title, url);
state:state对象,与要跳转到的URL对应的状态信息。
title:名称。
url:要跳转到的URL地址,不能跨域。