var mymethod = {
init: function(options){
//initialize
//how to call buildhtml from here;
},
buildhtml: function(){
//build inner html
},
sendrequest: function(){
//make ajax to send request
//can I call hoocrequest from here;
},
hoocrequest: function(){
//hooc ajax return value
}
};
How to call buildhtml or another from init or another ?
http://jsfiddle.net/xm5M8/
This method won’t work if you’re calling
initfrom a different context. For example:In such a case you need to either bind the context to the function reference:
Or provide the context when you call the function: