tags:

views:

41

answers:

2

Hi to all,

can you please tell me the how can we encode the ~ character in javascript..

i am trying with the encodeURIComponet.but that character is not encoding...

and also , how can we encode < and > characters in javascript...

tx inadvance...

regards patel

A: 

Here's a URL encoding reference.

moff
hey..thankou for ur reply
+2  A: 

The reason encodeURIComponent isn't encoding them is that they don't need to be encoded in a URI.

You can use

escape('~ < > ');

if you really want to

Greg