How to use encodeURI in JavaScript
This article describe about encodeURI() Function in JavaScript.
encodeURI() Function in JavaScript
It is used to encode the URL. And encodes the special characters, except: , / ? : @ & = + $ # ( encodeURIComponent() to encode these characters).
Note: decodeURI() function to decode an encoded URI
Syntax
Parameter |
Description |
uri |
Required. the URI to encoded. |
Example
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript">
var uri = "default.aspx?name=ståle&car=raman";
document.write(encodeURI(uri) + "<br />");
</script>
</body>
</html>
|
Output

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