
1、document表示的是一个文档对象,window表示的是一个窗口对象,一个窗口下可以有多个文档对象。所以一个窗口下只有一个windowlocationhref,但是可能有多个documentURL、documentlocationhref
2、windowlocationhref和documentlocationhref可以被赋值,然后跳转到其它页面,documentURL只能读不能写
3、documentlocationhref和documentlocationreplace都可以实现从A页面切换到B页面,但他们的区别是:
用documentlocationhref切换后,可以退回到原页面。
而用documentlocationreplace切换后,不可以通过“后退”退回到原页面。
1,设置或获取对象指定的文件名或路径。
alert(windowlocationpathname)
2,设置或获取整个 URL 为字符串。
alert(windowlocationhref);
3,设置或获取与 URL 关联的端口号码。
alert(windowlocationport)
4,设置或获取 URL 的协议部分。
alert(windowlocationprotocol)
5,设置或获取 href 属性中在井号“#”后面的分段。
alert(windowlocationhash)
6,设置或获取 location 或 URL 的 hostname 和 port 号码。
alert(windowlocationhost)
7,设置或获取 href 属性中跟在问号后面的部分。
alert(windowlocationsearch)
8,获取变量的值(截取等号后面的部分)
var url = windowlocationsearch;
var loc = urlsubstring(urllastIndexOf(‘=’)+1, urllength);
9,用来得到当前网页的域名
var domain = documentdomain;
以上就是关于如何通过JS获得网页的真实访问地址呢全部的内容,包括:如何通过JS获得网页的真实访问地址呢、怎么才能得到当前html的地址,实现浏览次、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)