- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
encodeURI() function in JavaScript
The encodeURI() function accepts a string value representing an URI and encodes it by replacing the characters in it using numbers (1 to 4) and escape sequence.
Syntax
Its Syntax is as follows
encodeURIComponent('http://www.qries.com/');
Example
<html> <head> <title>JavaScript Example</title> </head> <body> <script type="text/javascript"> var result1 = encodeURI('http://www.qries.com/?x=шеллы'); document.write(result1); document.write("<br>"); var result2 = encodeURI('http://www.tutorialspoint.com/?x=шеллы'); document.write(result2); </script> </body> </html>
Output
http://www.qries.com/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B http://www.tutorialspoint.com/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B
Advertisements