Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
jdw_if_ajax: serve and hide content
The plugin is available here.
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.
<txp:jdw_if_ajax>
// code for ajax goes here
<txp:else />
//other code goes here
</txp:jdw_if_ajax>
jdw_if_not_ajax
Container tag. When the page or form is requested by ajax, content won’t show.
<txp:jdw_if_not_ajax>
// skipped by ajax
</txp:jdw_if_not_ajax>
Last edited by colak (2015-11-11 17:20:49)
TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX
Offline
Re: jdw_if_ajax: serve and hide content
JanDW wrote:
Addition of a new tag: jdw_if_not_ajax.
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…
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#3 2010-02-22 10:16:19
- jelle
- Member
- Registered: 2006-06-07
- Posts: 165
Re: jdw_if_ajax: serve and hide content
Bloke wrote:
Hmmm, perhaps I should revisit it now they’ve fixed at least one of those two issues…
ooohhh….yes please.
Offline
Re: jdw_if_ajax: serve and hide content
bring ‘er on, I say!
Last edited by JanDW (2010-02-22 16:24:17)
TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX
Offline
Re: jdw_if_ajax: serve and hide content
Excellent Thanks !
As Stef says the <txp:jdw_if_not_ajax>
case is very useful !
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: jdw_if_ajax: serve and hide content
Cheers, Guillaume, glad you’re finding it useful.
TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX
Offline
Re: jdw_if_ajax: serve and hide content
Jan, when serving, in a page template (pages tab) the:
<txp:jdw_if_ajax>
call_this_form
<txp:else />
call_the_whole_page
<jdw_if_ajax>
Outputs a blank page :(
Last edited by hablablow (2010-03-22 13:42:17)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: jdw_if_ajax: serve and hide content
You’ve omitted </txp:
in the closing tag for </txp:jdw_if_ajax>
, is that it?
edit: Ahh, so have I in the example up top, it seems, lemme fix that fixed.
Last edited by JanDW (2010-03-22 13:47:50)
TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX
Offline
Re: jdw_if_ajax: serve and hide content
Also @Bloke
…the fact I couldn’t get the history to work properly
Last edited by JanDW (2010-03-22 14:09:36)
TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX
Offline
#10 2010-03-27 21:20:52
- sereal
- Member
- From: Indonesia
- Registered: 2010-02-18
- Posts: 55
Re: jdw_if_ajax: serve and hide content
is this plugin able to wrap the Comments Form ?
I’m looking for the way to make the Comments Form loads on a single DIV instead reload the whole page when the users clicking preview / submit button.
is that possible ?
please advise
thanks
$(mydocument).notyetready(function() {});
dowebsitesneedtolookexactlythesameineverybrowser ?
Offline
#11 2015-11-11 14:37:23
- dorka
- Member
- Registered: 2012-10-04
- Posts: 90
Re: jdw_if_ajax: serve and hide content
Hi there, the link to this usefull plugin is broken. Could someone, please, share a copy?
Thanks!
Offline
Offline