有没有人遇到过“encodeURIComponent(string)”的跨浏览器问题? [英] does anyone have experienced cross browser issues with "encodeURIComponent(string)"

查看:209
本文介绍了有没有人遇到过“encodeURIComponent(string)”的跨浏览器问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要动态地从一些自定义字符串值创建URL。我怀疑encodeURIComponent(string)函数是否已交叉浏览器问题是否有人遇到过这个函数的问题(我没有使用任何JS库)?

I need to make URL from some custom string values dynamically. I have doubt on "encodeURIComponent(string)" function whether it has cross browser issues does anyone experienced trouble with this function(I am not using any JS libraries)?

推荐答案

encodeURIComponent 按照跨浏览器的方式宣传。优先使用 escape

encodeURIComponent works as advertised in a cross-browser fashion. Use it in preference to escape.

这篇关于有没有人遇到过“encodeURIComponent(string)”的跨浏览器问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆