What is escape and unescape function in Javascript ?

The escape function encodes a string so that it can be easily read on
all computers, whereas unescape function decodes strings that are
encoded with escape function.

var strTest="Welcome John Smith";

strTest=escape(strTest);document.write (strTest); // returns
Welcome%20John%20Smith

strTest=unescape(strTest);document.write(strTest); // returns Welcome John Smith

No comments:

Post a Comment