If you have to use one file and you want your script to exit after executing an ajax request without having to add additional vars to the ajax url or evaluate the vars to exit, I would suggest creating a function that executes your ajax, the function returns true if success, then do:
if(ajaxFunction($paramOne, $paramTwo)){exit();}
Babiker
source share