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
精彩评论