window.location各属性含义
来源:互联网 发布:java冒泡排序 编辑:程序博客网 时间:2024/05/16 08:26
window.location方法获取URL
统一资源定位符 (Uniform Resource Locator, URL)
scheme://host:port/path?query#fragment
scheme:通信协议 常用的http,ftp,maito等 host:主机 服务器(计算机)域名系统 (DNS) 主机名或 IP 地址。 port:端口号 整数,可选,省略时使用方案的默认端口,如http的默认端口为80。 path:路径 由零或多个"/"符号隔开的字符串,一般用来表示主机上的一个目录或文件地址。 query:查询 可选,用于给动态网页(如使用CGI、ISAPI、PHP/JSP/ASP/ASP.NET等技术制作的网页)传递参数,可有多个参数,用"&"符号隔开,每个参数的名和值用"="符号隔开。 fragment:信息片断 字符串,用于指定网络资源中的片断。例如一个网页中有多个名词解释,可使用fragment直接定位到某一名词解释。(也称为锚点.)
示例:
http://www.home.com:8080/windows/location/page.html?ver=1.0&id=timlq#love 1, window.location.href 整个URl字符串(在浏览器中就是完整的地址栏) 返回值:http://www.home.com:8080/windows/location/page.html?ver=1.0&id=timlq#love 2,window.location.protocol URL 的协议部分 返回值:http: 3,window.location.host URL 的主机部分返回值:www.home.com
4.window.location.hostname
返回值:www.home.com:8080
5,window.location.port URL 的端口部分。如果采用默认的80端口(update:即使添加了:80),那么返回值并不是默认的80而是空字符。 本例返回值:8080 6,window.location.pathname URL 的路径部分(就是文件地址) 返回值:/windows/location/page.html 7,window.location.search 查询(参数)部分。除了给动态语言赋值以外,我们同样可以给静态页面,并使用javascript来获得相信应的参数值 返回值:?ver=1.0&id=timlq 7,window.location.hash 锚点 返回值:#love 1 0
- window.location各属性含义
- 关于window.location的各属性
- window.location属性详解
- window.location的属性
- window.location属性详解
- window.location.hash属性介绍
- window.location 属性方法复习
- window.location.hash属性介绍
- window.location.hash属性介绍
- window.location.hash属性介绍
- window.location.hash属性介绍
- window.location.hash属性介绍
- window.location.hash属性介绍
- window.location.hash属性介绍
- window.location后面的属性
- window.location.hashs属性介绍
- window.location.hash属性介绍
- window.location.hash属性介绍
- ue4-Multiplayer Lobby Blueprint教程
- hibernateUtil中hibernate3和hibernate4的区别
- H3C UIS R390X G2服务器 官方资料下载
- 博弈总结
- hdoj1202
- window.location各属性含义
- 手机调试遇到的问题
- 二项式的系数规律
- 开发模式——MVVM框架开发
- VS中使用svn注意事项
- JDBC性能小贴
- 代码调试找错总结
- Java 基础02Java编程基础
- Windows7上安装TensorFlow的GPU版本后记