I am new to ajax and callback functions, please forgive me if I realized that everything is wrong.
Problem: Can I send a callbackfunction as a parameter to another function that will execute the callback?
function firstFunction(){ //some code //a callback function is written for $.post() to execute secondFunction("var1","var2",callbackfunction); } function secondFunction(var1, var2, callbackfunction) { params={} if (event != null) params = event + '&' + $(form).serialize(); // $.post() will execute the callback function $.post(form.action,params, callbackfunction); }
javascript ajax callback call
Wee Kiat Jun 24 2018-11-11T00: 00Z
source share