.DataTable().ajax.url(testURL).load(); event on complete
.DataTable().ajax.url(testURL).load(); event on complete
Arudian
Posts: 11Questions: 5Answers: 1
HI,
I am using .DataTable().ajax.url(testURL).load(); to reload my page (based on some filters)
I was wandering if its possible to run some javascript function after this specific ajax request is completed.
I can't use $(document).ajaxComplete because i have more than 1 ajax request on page happening and i don't want those functions to be run on each ajax complete.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi Arudian,
The
xhr
may help, though I'm not sure how you could differentiate between the various other Ajax requests - maybe something like setting a flag or interrogating the data if it's going to be of a certain format for only that specific request.Hope that helps,
Cheers,
Colin
Thank you Colin, in this case i decided to go with $(document).ajaxStop(function () insted. It is not perfect as it dosen't target the specific ajax call, but is enough to serve my purpose.
BR,
ajax.url().load()
has a callback option that would be what you want in this case.Allan
Can't belive i have missed this.... Thank you Alan, exactly what i was looking for.
BR.