What's the best practive to detect an AJAX request in EE4 without activating PHP in the template?

With the previous version of EE, I used the Ajax Detect Conditional ({if ajax}, {if not_ajax}) from Mo'Variables, but the add-on is not EE4 compatible.

Thank you

1 Answer 1


Use the native {is_ajax_request} variable.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.