function hasInput(event){
//判断输入
this.input = event.data.foo;
};
hasInput.prototype.echo = function (){
alert(this.input);
}
怎么用bind绑定这个
$(":input").bind("blur",{foo: www"},hasInput.prototype.echo);
//判断输入
this.input = event.data.foo;
};
hasInput.prototype.echo = function (){
alert(this.input);
}
怎么用bind绑定这个
$(":input").bind("blur",{foo: www"},hasInput.prototype.echo);
<script src="js/jquery-1.3.2.js"></script>
<script>
function hasInput(){
this.input = null;
};
hasInput.prototype.echo = function (event){
this.input = event.data.foo;
alert(this.input);
}
var hi = new hasInput();
window.onload=function(){
$(":input").bind("blur",{foo:"www"},hi.echo);
}
</script>
<form>
<input type="text" >
</form>
function hasInput(){
};
里面 还有好几个属性在 echo里面需要利用,为了继承良好,我分离了属性和方法,你给的方法,好像不能解决上面传值的一些问题