Examples:

Default options:


<div id="post">
</div>
<?
echo $ajax->remoteTimer(
	array(
	'url' => array( 'controller' => 'ajax', 'action' => 'view', 1 ),
	'update' => 'post', 'position' => 'append', 'frequency' => 30
	)
);
?>          
            

Comments

  1. srumjant wrote:

    Hei.
    It is greate plugin.

    But how could I make it work so, that it would update different div depending on response xml.

    Thx, srumjant.

  2. kvas wrote:

    srumjant, you can use something like this:

    <?php
    echo $ajax->remoteTimer(
    array(
    'url' => array( 'controller' => 'ajax', 'action' => 'view', 1 ),
    'frequency' => 5, 'complete' => 'alert(request.responseText); your_function_here(request.responseText)'
    )
    );
    ?>

  3. BiBiBN wrote:

    => kvas: I 'm using your plugin, I also find the way how to update different div depending on response xml. Thanks so much, I really love you much :D

  4. Ay Dot wrote:

    @BiBiBN: care to share how you did that ?

  5. Roi wrote:

    Hello, I have a question about having an internal error. I followed everything in the installation guide but it is not working for me.
    <?php
    echo $this->Ajax->remoteTimer(
    array(
    'url' => array( 'controller' => '/inboxes/statistics', 'action' => 'index', 1 ),
    'update' => 'updates', 'frequency' => 10
    )
    );
    ?>
    here is my code. Thank you. :)

  6. kvas wrote:

    Hi Roi,
    What error do you get? How do you include your helper in controller?

Post a comment

 

Additional options:

  • $options['before'] - this options will be executed before sending Ajax request
  • $options['after'] - this options will be executed after sending Ajax request
  • $options['confirm'] - this options will be displayed in confirm window
  • $options['condition'] - Ajax request will be created only if condition will return true
  • $options['position'] - where responseText should be placed (posible values: html, text, append, prepend, after, before, wrap...)
  • $options['with'] - string parameters that will passed to Ajax data option
  • $options['form'] - id of form that will be serialized adn passed to Ajax data option
  • $options['indicator'] - id of element that will be shown while browser is waiting form response from server
  • $options['frequency'] - how often request should be fired (in seconds)
 

jQuery Ajax Helper

CakePHP is distributed under flexible licence - MIT Licence. I decided to publish my code on the same licence, so you can freely use IT!

If I made you interested go and download it now!