使用decodeURIComponent解码字符

版权声明: https://blog.csdn.net/qq_23521659/article/details/83540168

用url传参时,有中文,发现乱码了:

console.log($scope.parseURL())

这个字符类似于encodeURIComponent() 函数编码的 URI ;于是尝试使用decodeURIComponent解码:

console.log(decodeURIComponent($scope.parseURL()));

解码成功:

猜你喜欢

转载自blog.csdn.net/qq_23521659/article/details/83540168