does anyone have experienced cross browser issues with “encodeURIComponent(string)”

元气小坏坏 提交于 2019-12-21 13:40:22

问题


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)?


回答1:


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




回答2:


Go for it. This is exactly what encodeURIComponent is for and it's well-supported across browsers. I've never heard of a serious issue with it on any major implementation.



来源:https://stackoverflow.com/questions/4407599/does-anyone-have-experienced-cross-browser-issues-with-encodeuricomponentstrin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!