美文网首页
encodeURIComponent-拼接中文url

encodeURIComponent-拼接中文url

作者: 兔子不打地鼠打代码 | 来源:发表于2019-03-26 18:15 被阅读0次

指定进入微信地址,因为含中文字符,如果需要转成英文字符,要用JS函数encodeURIComponent进行可把字符串作为 URI 组件进行编码,其中的某些字符将被十六进制的转义序列进行替换

http://wechat.xxxxx.com:9000#/bind/switch-patient?title=排队叫号&type=wait

转义了中文字符排队叫号后为

http://wechat.xxxxx.com:9000#/bind/switch-patient?title=%E6%8E%92%E9%98%9F%E5%8F%AB%E5%8F%B7&type=wait

相关文章

网友评论

      本文标题:encodeURIComponent-拼接中文url

      本文链接:https://www.haomeiwen.com/subject/xnunvqtx.html