摘要: div1.onmousedown = function(e){ //var x = e.offsetX; // 有些浏览器不支持offsetX和Y //var y = e.offsetY; var x = e.clientX - div1.offsetLeft;//推荐使用这种写法获取offsetX和Y var y = e.clientY - div1.of... 阅读全文
posted @ 2018-04-21 17:37 悔创阿里-杰克马 阅读(124) 评论(0) 推荐(0)
摘要: var e = new Error("this is a Error"); console.log(typeof(e),e); thorw( e );//抛出错误 //容错 try{ //尝试执行try里面的代码 var a; console.log(a); }catch(e){ //参数e,表示错误 //如果try中代码出错,则执行catch里的代码 alert(e.message);... 阅读全文
posted @ 2018-04-21 11:45 悔创阿里-杰克马 阅读(85) 评论(0) 推荐(0)
求投食~(点图即可)