Friday, August 19, 2011

How to create a callback function in Javascript


function  MyCallback(name, callbakFn) {        
if  (typeof  (callbakFn) == 'function' ) {
callbakFn.call(this , name);
}
}
function  TestCallback() {
MyCallback('sriram' , function  (arg) {
alert(arg);
});
}


No comments:

Post a Comment