• 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 指定的文档来替换当前文档 ,这个方法是替换当前窗口页面,前后两个页面共用一个

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

  • 相关阅读:
    swift NSComparator
    Java mac 上编写Java代码
    四舍五入、上取整、下取整
    数组排序
    删除xcode 里的多余证书
    启动画面 设置
    CGFloat Float 互转
    navigationController pop的几种方法
    iOS 获取键盘相关信息
    eclipse代码格式化
  • 原文地址:https://www.cnblogs.com/mrszhou/p/8098133.html
Copyright © 2020-2023  润新知