1,HTML source code£º <html> <head> <title>How to use ArithmeticException</title> <script src="jsjava.js"></script> </head> <body> <script> function getQuotient(a,b){ var rs=a/b; if(rs==Infinity){ throw new ArithmeticException(ArithmeticException.ERROR,"b can not be zero!"); } } var quotient; try{ getQuotient(1,0); }catch(e){ document.write(e.message); } </script> </body> </html> 2,The display:

b can not be zero!