jdw_if_ajax: serve and hide content

Since dub_if_ajax is no longer up for grabs: here’s jdw_if_ajax . This plugin is based off dub_if_ajax (no longer available) by Jamie Wilkinson. It uses the x-requested-with header to deliver different content to Ajax calls.

Addition of a new tag: jdw_if_not_ajax.

jdw_if_ajax

Container tag. When the page or form is requested by ajax, content will show.

Re: jdw_if_ajax: serve and hide content

Nice, thanks. I wondered when someone was going to update the original plugin. The addition of the not case is much more useful than it seems on the surface, so thanks for that too.

When I wrote smd_ajax a couple of years ago — designed as a complete AJAX implementation for delivering TXP articles — I also put the same ‘not’ case in and found myself using it almost exclusively during site development. I think my plugin’s only in use on one site on the Internet as I never officially released it due to a jQuery bug on IE and the fact I couldn’t get the history to work properly. Hmmm, perhaps I should revisit it now they’ve fixed at least one of those two issues…