I have created an html page an used the following javascript to encode url entered in a text box.
However, it does not ecode all characters. I used a search url and tried to encode, but does not encode chars like #,=, etc. How can I encode urls in sharepoint using javascript?
var res = encodeURIComponent(url)
.replace(/!/g, '%21')
.replace(/'/g, '%27')
.replace(/\(/g, '%28')
.replace(/\)/g, '%29')
.replace(/\*/g, '%2A')
.replace(/%20/g, '+');
encodeURIComponent(url).