 for a recent project i needed to detect whether a request was an ajax request or not mx ajax detect already existed but i didnt like that you needed the extra set of tags usage if exp is ajax == true oh yeaaah if else oh nooo if download you can find the plugin on devot ee and github 