摘要: 1.try..catch.. <body><script>function myFunction(){try{ var x=document.getElementById("demo").value;//取值if(x=="") throw "值为空"; //返回错误提示if(isNaN(x)) th 阅读全文
posted @ 2017-04-02 15:38 wskxy 阅读(522) 评论(0) 推荐(0)
摘要: 1.页面加载时向body加载文本、弹出框 <body> <script> document.write("<h1>JavaScript 会在页面加载时向 HTML 的 <body> 写文本</h1>"); </script> <script> alert("加载页面弹出框"); </script>< 阅读全文
posted @ 2017-04-02 12:39 wskxy 阅读(546) 评论(0) 推荐(0)