Decoding a string

Puneet20884
Posted by Puneet20884 under JavaScript category on | Views : 1691
Decoding a string, in javascript can be done by the usage of its inbuilt function

unescape

we need to decode a string say when we have kept the encoded one and have to represent to client end
So to decode the string we need to use this function,
the simple code goes as:

document.write(unescape('gr8%20puneet.aspx?pra=t%C3%A5l&pcar=great'));

the output will be

gr8 puneet.aspx?pra=tål&pcar=great

Comments or Responses

Login to post response