重定向则用herf 和replace 
<script type="text/javascript">
     location.href='http://www.xxx.com/';
</script>

<script type="text/javascript">
     location.replace('http://www.xxx.com/');
</script>

两者的不同之处是前者会在浏览器的历史浏览记录(history对象)中增加一条新的记录,而后者则是相当于用replace中的url代替了现有的页面url,并把history中的url也替换为重定向后的url。

 

摘自:http://www.cnblogs.com/dongzhiquan/archive/2010/08/08/1994580.html

相关文章:

  • 2021-11-28
  • 2022-12-23
  • 2021-07-19
  • 2022-01-06
  • 2021-12-22
  • 2021-11-26
  • 2021-09-03
  • 2021-11-22
猜你喜欢
  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
相关资源
相似解决方案