1.取得浏览器网址的地址
let currentUrl = window.location.href
2.获取url具体字段
![](https://img.haomeiwen.com/i4752086/fc0040dfecdbfa3d.png)
3.代码替换浏览器中的key和value值
![](https://img.haomeiwen.com/i4752086/77575e83cfdf7e82.png)
4.取得浏览器的值并decode到数据
![](https://img.haomeiwen.com/i4752086/cb3b5c8a7e7cd595.png)
其中IE9无法编译%这个特殊字段,对其进行了特殊处理
5.利用vue hash的方式,在不刷新页面的情况下,对网址进行改变的操作,使用history.replaceState,为了兼容IE9,只能使用window.open
![](https://img.haomeiwen.com/i4752086/ffad231893eaa42b.png)
1.取得浏览器网址的地址
let currentUrl = window.location.href
2.获取url具体字段
3.代码替换浏览器中的key和value值
4.取得浏览器的值并decode到数据
其中IE9无法编译%这个特殊字段,对其进行了特殊处理
5.利用vue hash的方式,在不刷新页面的情况下,对网址进行改变的操作,使用history.replaceState,为了兼容IE9,只能使用window.open
本文标题:IE9下对网址编码的常用方法
本文链接:https://www.haomeiwen.com/subject/ftyhvctx.html
网友评论