Can anyone assist me in getting a function to be called, in this example the second() after the function before has finished? The first function called contains an ajax call.
function requestPost(postID, clientId) {
first("path", { postID: postID, clientId: clientId});
second(); // this is where I want to call the second() but only the first() has completed.
}
Thanks
You should probably specify the ajax function/library/whatever that’s being used. That’ll simplify answers. If that ajax function has a callback mechanism, you can just do:
In other words, pass the function as a callback to the ajax function.