JavaScript Error name Property - URIError:An error in encodeURI() has occurred - Javascript DOM

Javascript examples for DOM:Error

Description

JavaScript Error name Property - URIError:An error in encodeURI() has occurred

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Errors</h1>

<p>Some characters cannot be URI decoded:</p>

<p id="demo"></p>

<script>
try {/*from  w w w . ja v  a  2s .c o  m*/
    decodeURI("%%%");
}
catch(err) {
    document.getElementById("demo").innerHTML = err.name;
}
</script>

</body>
</html>

Related Tutorials