zoukankan      html  css  js  c++  java
  • window.location 方法及作用

    字段:http://localhost:9094/#/source/source-catalog
    1、设置或获取整个 URL 为字符串

    window.location.href
    http://localhost:9094/#/source/source-catalog

    2、设置或获取 URL 的协议部分

    window.location.protocol
    http:

    3、设置或获取 URL 的主机部分

    window.location.host
    localhost:9094

    4、设置或获取与 URL 关联的端口号码

    window.location.port
    9094

    5、设置或获取与 URL 的路径部分(就是文件地址)

    window.location.pathname
    直接设置,端口后会直接加上下载路径
    /rcservcie/doc?5c3a975b-3773-467c-a52a-5a490f38cf44
    http://localhost:9094/rcservcie/doc%3F5c3a975b-3773-467c-a52a-5a490f38cf44#/source/source-catalog

    6、设置或获取 href 属性中跟在问号后面的部分

    window.location.search
    resource_id=bee59caad39a490e9411c5af1dfcab40

    7、设置或获取 href 属性中在井号“#”后面的分段

    window.location.hash
    #/source/source-catalog

  • 相关阅读:
    php获取文件后缀名格式
    猴子分桃问题2
    猴子吃桃问题1
    判断字符串中字母出现的次数用分割法
    成绩表
    二维数组所有元素求和输出
    冒泡排序
    1.8作业
    1.8
    1.6
  • 原文地址:https://www.cnblogs.com/bu1204/p/14763378.html
Copyright © 2011-2022 走看看