首页 > 代码库 > window.location
window.location
1 $(function(){ 2 //标记当前TAB 3 $("[data-tab-tag]").each(function(){ 4 var tag = $(this).data("tab-tag"); 5 if(window.location.toString().indexOf(tag) != -1){ 6 $("[data-tab-tag]").removeClass("layui-this"); 7 $(this).addClass("layui-this"); 8 } 9 });10 });11 </script>12 13 window.location是一个对象,包含属性有14 hash 从井号 (#) 开始的 URL(锚)15 host 主机名和当前 URL 的端口号16 hostname 当前 URL 的主机名17 href 完整的 URL18 pathname 当前 URL 的路径部分19 port 当前 URL 的端口号20 protocol 当前 URL 的协议21 search 从问号 (?) 开始的 URL(查询部分)22 获取window.location.href是最常用的
http://www.w3school.com.cn/js/js_window_location.asp
https://developer.mozilla.org/zh-CN/docs/Web/API/Window/location
window.location
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。