I have the following function:
function loadProjects(pID) {
$.ajax({
url: myURL,
success: function (dataJS) {XXXXXXXXXXXXXXXX}
});
}
I call this function like so loadProjects(1);
Issue is I want to be able to define a callBack function after success, and I'd like to include it when I do loadProjects(1, callback:{whatever js is included here gets called back after success})
How can I have a function accept a callback? How can I pass a callback to that function?
Thanks