When I try to call "Test" function I get an error.
How to fix that? (no jquery!)
Browser:firefox
error:
类型: 测试不是功能
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
MyClass = function(){
}
MyClass.prototype = {
Init: function(){
var txt = document.getElementById("text");
if (txt.addEventListener) {
txt.addEventListener("keyup", this.Foo, true)
}
},
Foo: function(){
this.Test();
},
Test: function(){
alert( OK );
}
}
window.onload = function(){
obj = new MyClass;
obj.Init();
}
</script>
</head>
<body>
<textarea id="text" rows="10">
</textarea>
</div>
</body>