js获取当前页面URL地址
2016-03-05 16:03
585 查看
设置或获取对象指定的文件名或路径。
alert(window.location.pathname)
设置或获取整个 URL 为字符串。
alert(window.location.href);
设置或获取与 URL 关联的端口号码。
alert(window.location.port)
设置或获取 URL 的协议部分。
alert(window.location.protocol)
设置或获取 href 属性中在井号“#”后面的分段。
alert(window.location.hash)
设置或获取 location 或 URL 的 hostname 和 port 号码。
alert(window.location.host)
设置或获取 href 属性中跟在问号后面的部分。
alert(window.location.search)
alert(window.location.pathname)
设置或获取整个 URL 为字符串。
alert(window.location.href);
设置或获取与 URL 关联的端口号码。
alert(window.location.port)
设置或获取 URL 的协议部分。
alert(window.location.protocol)
设置或获取 href 属性中在井号“#”后面的分段。
alert(window.location.hash)
设置或获取 location 或 URL 的 hostname 和 port 号码。
alert(window.location.host)
设置或获取 href 属性中跟在问号后面的部分。
alert(window.location.search)
相关文章推荐
- 关于jsp网页弹出窗口[很多种方法......]
- js 获取范围内的随机数
- jsp中通过部署标识符方式配置filter、listener、servlet
- js将iframe中控件的值传到主页面控件中的实现方法
- JS面向对象组件(三)--面向对象中的常用属性和方法
- JS事件代理
- javascript将毫秒还原为可读时间格式
- javascript之基本包装类型(Boolean,Number,String)基础篇
- 千里码【78】json&xml
- javascript获取指定链接GET参数函数
- Javascript学习笔记:6种实现继承的方式
- javascript获取Iframe父页面函数
- javascript <![CDATA[的web使用简单说明
- JS第六天
- JS 数组扩展函数--求起始项到终止项和
- JavaScript中的类数组对象
- 传智博客 js(三)
- three.js制作一个立体几何体
- javascript 常见方法
- 传智博客 js学习(二)