JavaScript中异常处理 try{ //可能会出错的代码块 asdf; }catch(err){ //捕获错误! //TODO handle the exception console.log("错误!~"); }finally{ //不管对与错一定会执行 console.log("ok"); }