Encoding a string.

Puneet20884
Posted by Puneet20884 under JavaScript category on | Views : 1529
Encoding in javascript can be done by the usage of its inbuilt function

unescape()

we need to encode sometimes the values say when the user input the special characters etc that the javscript doesn't take.
So to encode a string we need to use this function,
the simple code goes as:

document.write(unescape("ahsdfasjdf?asdf?^%^&%6"));

the output will be

ahsdfasjdf?asdf?^%^&%6

Comments or Responses

Login to post response