源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>享学课堂</title> </head> <body> <h1>JavaScript Errors</h1> <p>有些字符不能是URI解码:</p> <p id="demo"></p> <script> try { decodeURI("%%%"); } catch(err) { document.getElementById("demo").innerHTML = err.name; } </script> </body> </html>
运行结果