代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>我的个人网站</title> <Meta name="Generator" content="EditPlus"> <Meta name="Author" content=""> <Meta name="Keywords" content=""> <Meta name="Description" content=""> <script> /* try { var i=5; if(i==5) { throw new Error("报错啦!"); } } // JavaScript中不能有多种Catch catch (e) { document.write("错误信息"+e.message+"<br/>"); } finally{ document.write("finally<br/>"); } */ /* 避免重复书写对象 with(document)//省去document.write()的重复书写 { write("输出第一行数据<br/>"); write("输出第二行数据<br/>"); write("输出第三行数据<br/>"); } */ </script> </head> <body> </body> </html>