|
JavaScript decodeURIComponent() Function
Complete Function Reference
Definition and Usage
The decodeURIComponent() function decodes a URI encoded with the encodeURIComponent() function.
Syntax
|
decodeURIComponent(URIstring)
|
| Parameter |
Description |
| URIstring |
Required. The URI to be decoded |
Example
In this example we use decodeURIComponent() to decode a URI after encoding it:
<script type="text/javascript">
var test1="http://www.w3schools.com/js/";
document.write(encodeURIComponent(test1)+ "<br />");
document.write(decodeURIComponent(test1));
</script>
|
The output of the code above will be:
http%3A%2F%2Fwww.w3schools.com%2Fjs%2F
http://www.w3schools.com/js/
|
|
Complete Function Reference
|