• 1
name Punditsdkoslkdosdkoskdo

How to escaping ampersand in url

I am trying to send a GET message that contains strings with ampersands and can't figure how to escape the ampersand in the url.

result => candy_name = M

I also tried:
result => candy_name = M\

I am using urls manually so I just need the correct characters.

I can't use any libraries. How can it be done?

They need to be percent-encoded:

> encodeURIComponent('&')

So in your case, the URL would look like:
  • 1
Reply Report