开发者

escape & in url

How can I escape & (ampersand) in url with the correct replacement in the jQuery function. I have tried

.replace("/&/g", "&")  
.replace("/&/g", "%26") 
.replace("/&/g", "\&") 

But nothing is w开发者_Python百科orking.

If anyone has idea please share with me.

Thanks


If you need to just escape a URL, I recommend using a JavaScript function such as encodeURIComponent.


Try the URLEncode plugin: http://plugins.jquery.com/project/URLEncode

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜