Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Txp Ajax
HI.
After download TXP 4.5 I don’t found any information about txpAsyncForm and txpAsyncHref.
How can i use it?
There is some wiki or example?
Thanks
Offline
Re: Txp Ajax
Start here.
Offline
Re: Txp Ajax
wet wrote:
Start here.
Thanks for sample.
Minor fix, change line 120 to
__CLASS__
and line 130 to
$in = escape_js(ps('my_name'));
aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)
Offline
Re: Txp Ajax
Good catch. Fixed.
Offline
Re: Txp Ajax
Are there any ideas about textpattern and frontside-ajax?
Or just take a jquery
+ callback('pretext')
?
aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)
Offline
Re: Txp Ajax
Most js frameworks (jQuery and such) send HTTP_X_REQUESTED_WITH
header, so you could filter ajax calls this way:
<txp:etc_query globals="_SERVER" data="{?HTTP_X_REQUESTED_WITH}">
ajax stuff
<txp:else />
non-ajax
</txp:etc_query>
Offline
Re: Txp Ajax
Thanks Robert!
Offline
Re: Txp Ajax
Robert in your example plugin you use a new tab under extension.
If I try using a plugin_ui as register_callback(array(__CLASS__, 'dispatch'),'image_ui','extend_controls');
with your original plugin’s function it show the correct form, but when i click on Hello, it return all html page with all images!!
Why it not work?
Offline
Re: Txp Ajax
Marco, the image tab does not use an AJAX form.
If you want to extend the image form, your duties include adding a form which sends its request via AJAX (which you did), plus adding some code which replies with a suitable response (which you apparently did not).
If you try to extend an existing form like the image tab which doesn’t use AJAX itself you have to suppress the core’ s own responses. Otherwise the server will continue to output plain HTML. There’s nothing which tells it otherwise.
Offline
Re: Txp Ajax
I reopen this 3D.
I’m doing some experiments with ajax call… and thanks to Robert example I understand how the 2 funcs works.
What i don’t know is how can I create inside a ajax Form two ajax call. Ok, i can use a txpAsyncHref() but whit this function I can’t manipulate the dom of the page.
For doing this thing i need a txpAsyncForm so I can put some js code by send_script_response() but I can’t nested two forms.
There is another way?
Offline
Pages: 1