I have a javascript array with special characters are getting populated from back-end database. I wanted to escape those characters on the front-end to form query string to get the results properly. my array shown below:
var a = new Array();
a[0] = "abc,def";
a[1] = "abc:def";
a[2] = "abc(def)";
my query string formation as shown below:
http://localhost:8080/search/?Ar=AND(OR(category1:abc,def),OR(category2:abc:def),OR(category3:abc(def)));
my query string parameter is getting separated by ':" character, but my data itself having ':' characters are failing my query to get the results. I triend encodeURIComponent() in-built functions, but it fails in linux box.Escape special characters should support both window and linux as well. Any help on this?