|
JavaScript encodeURI() Function
Complete Function Reference
Definition and Usage
The encodeURI() function encodes a string as a URI.
Syntax
| Parameter |
Description |
| URIstring |
Required. The URI to be encoded |
Tips and Notes
Note: The encodeURI() function encodes special characters, with the
exception of:
, / ? : @ & = + $ #. Use the encodeURIComponent() function to encode these characters.
Tip: Use the decodeURI() function to decode URIs encoded
with encodeURI().
Example
In this example we use encodeURI() to encode URIs:
<script type="text/javascript">
var test1="£€";
document.write(encodeURI(test1)+ "<br />");
document.write(decodeURI(test1));
</script>
|
The output of the code above will be:
|
Complete Function Reference
729,913 sites built with Wix. Make your own
Click here to design a Stunning Flash Website for Free
Wix is a revolutionary web design tool that provides anyone with the possibility to create professional and beautiful websites for free.
With e-commerce features, search engine visibility and many more professional tools, Wix is the ultimate solution for creating a spectacular site while saving tons of money.
|