js获取url参数&vue.js获取url参数 &JQ获取url参数
在WEB开发中,时常会用到javascript来获取当前页面的url网址信息,在这里是我的一些获取url信息的小总结。
1、window.location.href(设置或获取整个 URL 为字符串)
var test = window.location.href;
alert(test);
返回:http://i.jb51.net/EditPosts.aspx?opt=1
2、window.location.protocol(设置或获取 URL 的协议部分)
var test = window.locat
原创
2020-09-29 17:59:19 ·
1215 阅读 ·
0 评论