I need a javascript function to hex-encode a plus sign so I can
pass the plus sign as an argument in a GET request. escape() and
encodeURI() don't do it (and probably shouldn't, because '+' is
a valid character in a URI). I could write a regexp, but the
environment I'm in won't allow replace(). I could write something
cumbersome using indexOf, but if there's something easier, like
a builtin function that encodes every character in the string, I'd
prefer that. I'm a newbie at js, so type slowly, please.
pass the plus sign as an argument in a GET request. escape() and
encodeURI() don't do it (and probably shouldn't, because '+' is
a valid character in a URI). I could write a regexp, but the
environment I'm in won't allow replace(). I could write something
cumbersome using indexOf, but if there's something easier, like
a builtin function that encodes every character in the string, I'd
prefer that. I'm a newbie at js, so type slowly, please.
Comment