window.location 对象所包括的属性

hash//从井号 (#) 開始的 URL(锚)

host//主机名和当前 URL 的port号

hostname//当前 URL 的主机名

href//完整的 URL

pathname//当前 URL 的路径部分

port//当前 URL 的端口号

protocol//当前 URL 的协议

search//从问号 (?) 開始的 URL

要使用 JS 定位锚点,全然能够使用 window.hash 配合元素 ID 完毕。

要使用 JS 捕获页面 GET 方式请求的參数。全然能够使用 window.location.search 获得,然后通过 split 方法结合循环遍历自由组织数据格式。



具体解释window.location的更多相关文章

  1. window.location事件

    一.最外层top跳转页面,适合用于iframe框架集 top.window.location.href("${pageContext.request.contextPath}/Login_g ...

  2. window.location.href和window.open的几种用法和区别

    使用js的同学一定知道js的location.href的作用是什么,但是在js中关于location.href的用法究竟有哪几种,究竟有哪些区别,估计很多人都不知道了. 一.location.href ...

  3. Javascript Window Location

    window.location 对象在编写时可不使用 window 这个前缀. URL : 统一资源定位符 (Uniform Resource Locator) 说明: 完整的URL示例:scheme ...

  4. window.location.href问题,点击,跳转到首页

    onClick="window.location.href='./';" 点击,跳转到首页. location.href=url Js中实现跳转 window.location.h ...

  5. window.location.href/replace/reload()--页面跳转+替换+刷新

    一.最外层top跳转页面,适合用于iframe框架集 top.window.location.href("${pageContext.request.contextPath}/Login_g ...

  6. 一个简单的样例看明确怎样利用window.location.hash实现ajax操作时浏览器的前进/后退功能

    我们知道JavaScript中非常早就提供了window.history对象,利用history对象的forward().go().back()方法可以方便实现不同页面之间的前进.后退等这样的导航功能 ...

  7. window.location获取URL中各部分

    博客分类: JAVASCRIPT JavaScriptASP.netSchemeASP网络协议  URL即:统一资源定位符 (Uniform Resource Locator, URL) 完整的URL ...

  8. window.location各属性含义

    window.location方法获取URL   统一资源定位符 (Uniform Resource Locator, URL)   完整的URL由这几个部分构成:   scheme://host:p ...

  9. window.location.reload();页面实现跳转和刷新

    1 history.go(0)2 location.reload()3 location=location4 location.assign(location)5 document.execComma ...

随机推荐

  1. POJ --3045--Cow Acrobats(贪心模拟)

    Cow Acrobats Time Limit: 1000MS   Memory Limit: 65536KB   64bit IO Format: %I64d & %I64u Submit ...

  2. hdoj--1005--Number Sequence(规律题)

    Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  3. matplotlib 可视化 —— 绘制常见图形

    0. 饼状图 plt.pie():Python数据可视化:饼状图 1. 三角形 描点连线,起点和终点相同 triangle1 = ((0, sqrt(3)/2), (1, 3*sqrt(3)/2), ...

  4. Tuple assignment

    It is often useful to swap the values of two variables. With conventional assignments, you have to u ...

  5. VS 代码打包工具

    源代码下载地址 https://github.com/loresoft/msbuildtasks

  6. Activity的启动模式和onNewIntent()

    1:首先,在默认情况下,当您通过Intent启到一个Activity的时候,就算已经存在一个相同的正在运行的Activity,系统都会创建一个新的Activity实例并显示出来.为了不让Activit ...

  7. C#共享WIFI能通过代码控制给连接的移动端分配IP么

    用C#创建了一个虚拟WIFI,但是能不能通过代码来给连接上的移动端分配各自的IP.之前都是自动分配的IP.望大神们赐教 C#共享WIFI能通过代码控制给连接的移动端分配IP么 >> csh ...

  8. [ Java ] [ Eclipse ] content Auto activation triggers

    重點: That plug-in is not necessary any more. Just go to Preferences > Java > Editor > Conten ...

  9. NodeJS学习笔记 (27)实用工具模块-util(ok)

    debuglog(section) 很有用的调试方法.可以通过 util.debuglog(name) 来创建一个调试fn,这个fn的特点是,只有在运行程序时候,声明环境变量NODE_DEBUG=na ...

  10. POJ 3539 Elevator(同余类BFS)

    题意 有一部电梯,最初停在1层. 电梯有4个按键,上升a,b,c层,回到一层. 求从一层出发.能到达1~h的哪些楼层. (h<=1018,a,b,c<=105) 题解 这种h能大的图论,一 ...