下面这种解析url路径跳转在很多机上的ie11浏览器上测试都ok
但在有一台ie11浏览器上解析会有问题
比如这个地址http://www.abc.com/m/tt/132
在个别机上的ie浏览器下会成http://www.abc.com/m/tt/undefined/m/tt/132
好生奇怪为什么会解析成这样?
let pathname = window.location.pathname;
let href = window.location.origin;
if(/^\/m\//.test(pathname)){
pathname = pathname.replace(/\/m/,'');
window.location.href = href + pathname;
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...