zoukankan      html  css  js  c++  java
  • JavaScript--location.href的跳转

    页面重载

      true 强制从服务器加载
      false 优先从缓存加载
      window.location.reload(true);



    window.location.href、self.location.href、location.href是本页面跳转 parent.location.href 是上一层页面跳转 top.location.href 是最外层的页面跳转
            window.history.forward()    前进
            window.history.back()       后退
            window.history.go(1)        前进
            window.history.go(-1)       后退

    window.location.href = "http://www.baidu.com";
    window.location.assign(
    "http://www.baidu.com");
    window.location.replace(
    "http://www.baidu.com");

    window.location.assign(url) : 加载URL 指定的新的 HTML 文档。就相当于一个链接,跳转到指定的url,当前页面会转为新页面内容,可以点击后退返回上一个页面。

    window.location.replace(url) : 通过加载 URL 指定的文档来替换当前文档 ,这个方法是替换当前窗口页面,前后两个页面共用一个

    窗口,所以是没有后退返回上一页的

  • 相关阅读:
    Java Number & Math 类
    excel小技巧-转置(表的横向纵向倒过来)
    excel小技巧-提取填充
    excel小技巧-分列
    Java switch case语句
    if...else
    12.15个人总结
    12.9个人总结
    11.29个人总结
    11.25日个人总结
  • 原文地址:https://www.cnblogs.com/mrszhou/p/8098133.html
Copyright © 2011-2022 走看看