How to use escape in JavaScript

This article describe about escape() Function in JavaScript.
  • 1666

escape() Function in JavaScript

For encodes string use escape() function.

The escape() function make string portable, that is why it is transmitted across any network that support ASCII characters.

And encode special characters, except that   * @ - _ + . /

Syntax

escape(string)

 

Parameter Descroption
string Required. String to be encoded.

Example

<!DOCTYPE html>

<html>

<body>

<script type="text/javascript">

    document.write(escape("For Need any tips? Visit dotnetheaven.com"));

</script>

</body>

</html>

 

Output

 

pic3.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.