try…catch 语句try…catch 语句<!DOCTYPE html><html><body> <p id="demo"></p> <script>try { adddlert("欢迎您,亲爱的用户!");}catch(err) { document.getElementById("demo").innerHTML = err.message;}</script> </body></html>