create callback function

function main(callback) {
     // ... do your thing
     var response = '555';
               
     //return response
     callback(response);
}

main(function(response){
     alert(response);
});

Related posts:

This entry was posted in jquery. Bookmark the permalink.