JavaScript | escape()
The escape() function takes a string as a parameter and encodes it so that it can be transmitted to any computer in any network which supports ASCII characters.
Syntax :
escape(string)
Note : This function only encodes the special characters.
Exceptions : @ – + . / * _
<script> // Special character encoded with // escape function document.write(escape("Geeks for Geeks!!!")); document.write("<br>"); // Print encoded string using escape() function // Also include exceptions i.e. @ and . document.write(escape("To contribute articles contact us at" + "contribute@geeksforgeeks.org")); </script> |
chevron_right
filter_none
Output :
Geeks%20for%20Geeks%21%21%21 To%20contribute%20articles%20contact%20us%20atcontribute@geeksforgeeks.org
Recommended Posts:
- Introduction to JavaScript Course | Learn how to Build a task tracker using JavaScript
- JavaScript Course | Understanding Code Structure in JavaScript
- JavaScript Course | Data Types in JavaScript
- JavaScript Course | Logical Operators in JavaScript
- JavaScript Course | Printing Hello World in JavaScript
- JavaScript Course | Conditional Operator in JavaScript
- JavaScript Course | JavaScript Prompt Example
- JavaScript Course | Functions in JavaScript
- JavaScript Course | Loops in JavaScript
- JavaScript Course | Operators in JavaScript
- JavaScript Course | Variables in JavaScript
- JavaScript Course | Objects in JavaScript
- JavaScript vs Python : Can Python Overtop JavaScript by 2020?
- How to include a JavaScript file in another JavaScript file ?
- Map.get( ) In JavaScript
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



