ajax update

I want to update a div of my page with ajax.

I want to ask is cake has his way to set the css for this ajax request .

I ask this because I convert this site form another framework and the ajax code is ready.

Asked by dimis283, on 5/7/10

I use jquery for the ajax update

dimis283 - on 5/7/10

<< comments | comments >>

1 Answer

I would suggest going the 1.3 way and use JsHelper (combined with jQuery or whatever lib you like). More info found in the book here.

An example:


echo $js->submit('AJAX confirm', array(
	'url' => array('controller' => 'your_controller', 'action' => 'your_action'), 
	'update' => '#content',
	'before' => $this->Js->get('#busy-indicator')->effect('fadeIn', array('buffer' => false)),
	'complete' => $this->Js->get('#busy-indicator')->effect('fadeOut', array('buffer' => false)),
));

Ofourse submit can be replaced with another method but this should give an idea.

Answered by bravokernelon 5/7/10

<< previous next >>

Your Answer

You can use Creole Wiki Syntax to format your text.

Tagged with

Rating

0

Viewed

149 times

Last Activity

on 5/7/10