<txp:dub_if_ajax>, a small helper tag that tests if the current page is being called via an XMLHttpRequest. Works great with jQuery or Prototype, which publish the needed HTTP_X_REQUESTED_WITH header — YMMV.
This can be used so that pages my be pulled in via AJAX or displayed on their own with minimal effort. I generally put it at the top of a page, only outputting page layout elements if it’s not being called by AJAX.
<txp:dub_if_ajax>
This code is being called from an AJAX function. Just output the article, etc.
<txp:else />
Regular page. Add visual fluff.
</txp:dub_if_ajax>
Check out the demo
Commenting is closed for this article.