Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions Explain unescape() and escape() in JavaScript?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


samar
Explain unescape() and escape() in JavaScript?
1 Answer(s)      4 years and a month ago
Posted in : JavaScript Questions


Explain unescape() and escape() in JavaScript?


Advertisement
View Answers

November 11, 2010 at 11:41 AM


The escape() function encodes a string.

This function makes a string portable, so it can be transmitted across any network to any computer that supports ASCII characters.

This function encodes special characters, with the exception of: * @ - _ + . /

<script type="text/javascript">

document.write(escape("Need tips? Visit here"));

</script>

The unescape() function decodes an encoded string.

<script type="text/javascript">

str="Need tips? Visit here";
str_escape=escape(str);
document.write(str_escape + "<br />")
document.write(unescape(str_escape))

</script>


Related Tutorials/Questions & Answers:
 

 

 

DMCA.com