encodeURIComponent-拼接中文url
2019-03-26 本文已影响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