location.href,location.asssign,location.replace的区别
区别在于:
location.href与location.assign()效果一样,location.href=“index.html”;是属性。可以回退到上个页面
location.assign(“index.html”)是方法,可以回退到上个页面
location.replace();会替换,改变url地址,无法回到上一个页面
location.href,location.asssign,location.replace的区别
区别在于:
location.href与location.assign()效果一样,location.href=“index.html”;是属性。可以回退到上个页面
location.assign(“index.html”)是方法,可以回退到上个页面
location.replace();会替换,改变url地址,无法回到上一个页面