[code]
<script language=”javascript” type=”text/javascript”>
function call(){
alert(“this is call”);
}
function Obj(){
this.call=call;
this.a;
}
function btn_onclick(){
event.returnValue=false;
var obj1=new Obj();
obj1.call();
}
</script>
<input type=”submit” id=”btn” onclick=”btn_onclick()”/>
What I want to do is when I click the button, “this is call” message will appear. I want to do it in a object-oriented way, so I make the “obj” to be my object and the “call()” to be the method inside my “obj” object. The above codes is working after tested, but somehow if I want to pass the parameter to the call method,eg call(messageToBeDisplay), how to I adjust the code that I put above? In short, I simply do not know how to write the method that contains the parameter for the object.