zoukankan      html  css  js  c++  java
  • location对象

    对location进行梳理,平时用的时候都是用什么看什么,今天把location整理一下,方便查询

    完整的URL地址:http://192.168.5.203:8888/demo/demo.html?name=fly&age=18#怪诞咖啡
    location  =>  http://192.168.5.203:8888/demo/demo.html?name=fly&age=18#怪诞咖啡
    hash      =>  #怪诞咖啡
    host      =>  192.168.5.203:8888
    hostname  =>  192.168.5.203
    href      =>  http://192.168.5.203:8888/demo/demo.html?name=fly&age=18#怪诞咖啡
    origin    =>  http://192.168.5.203:8888
    pathname  =>  /demo/demo.html
    port      =>  8888
    protocol  =>  http:
    search    =>  ?name=fly&age=18

    location.assign('地址') 等同于 location.href = '地址' 和 window.location = '地址'

    后两者使用的时候,也是触发assign()方法,进行跳转的

    跳转到新的页面,又可以把历史记录中的地址替换掉

    location.replace('地址')

    重新加载当前页面:

    location.reload()  有可能从缓存中加载

    location.reload(true)  从服务器重新加载

  • 相关阅读:
    切换svn用户
    表session查询
    http请求响应头信息
    map遍历的四种方法
    java i/o读写
    excel导出
    平安医保权限管理关系
    json发送hppt请求
    weblogic配置路径
    《神经网络和深度学习》系列文章十五:反向传播算法
  • 原文地址:https://www.cnblogs.com/liu-fei-fei/p/7359976.html
Copyright © 2011-2022 走看看