<script>
function zEvent(){
this.type=null;
this.target=null;
this.relatedTarget=null;
this.cancelable=false;
this.timeStamp=null;
this.returnValue=true;
};
zEvent.prototype.initEvent=function($a,$b){
this.type=$a;
this.cancelable=$b;
this.timeStamp=(new Date()).getTime();
};
zEvent.prototype.preventDefault=function(){alert();
if(this.cancelable){this.returnValue=false;}
};
function zDragDropEvent(){
zEvent.call(this);//①
};
zDragDropEvent.prototype=new zEvent();//②var dz= new zDragDropEvent();
//dz.timeStamp="ss";
//dz.type="sss";
alert(dz.timeStamp);
dz.preventDefault()
alert(zDragDropEvent.prototype.timeStamp);
</script>语句①和语句②是不是有些重复,可以将①去掉
解决方案 »
- 用JS点击<a href='javascript:void("关闭")' role="button">链接
- 使iframe 在ie 和 firefox 上的問題
- Javascript事件问题,帮忙给个思路!
- 请教 关于js删除问题
- --------------------------------------------下面代码有点看不懂
- 文本框得到图片的路径以后自动显示图片
- 很简单的验证全是数字的js正则,看不出来哪里错了,不好意思,帮我看看
- 多复选框取值问题,怎样得到复选框的值,并输出到一个INPUT框!
- 如何把window.open方法打开的窗口关闭
- 关于js中childNodes值的问题
- JSP 全局变量
- javascript控制表格的显示
zEvent.call(this);//①
};
相当于实例变量。
zDragDropEvent.prototype=new zEvent();//②
相当于定义一个静态变量(类变量)。