js获取当前页面的url网址信息
(编辑:jimmy 日期: 2026/1/24 浏览:2)
1、设置或获取整个 URL 为字符串:
window.location.href
2、设置或获取与 URL 关联的端口号码:
window.location.port
3、设置或获取 URL 的协议部分
window.location.protocol
4、设置或获取 href 属性中跟在问号后面的部分
window.location.search
5、获取变量的值(截取等号后面的部分)
复制代码 代码如下:
var url = window.location.search;
// alert(url.length);
// alert(url.lastIndexOf('='));
var loc = url.substring(url.lastIndexOf('=')+1, url.length);
6、设置或获取 URL 的协议部分:
window.location.protocol
7、设置或获取 href 属性中在井号“#”后面的分段:
window.location.hash
8、设置或获取 location 或 URL 的 hostname 和 port 号码:
window.location.host
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。