Default options:

<p id="post">
            'url' => array( 'controller' => 'ajax', 'action' => 'view', 1 ), 
            'update' => 'post' 
    )); ?>

Anchor moseover:

This request will be fired when you hover this link

<p id="post2">
    <a onmouseover="<?=$ajax->remoteFunction( 
            'url' => array( 'controller' => 'ajax', 'action' => 'view', 2 ), 
            'update' => 'post2' 
    )?>">This request will be fired when you hover this link</a>


  1. AC wrote:

    great stuff!
    what is the easiest way to get the returned data ( upon success) in the previous example. For example if I want to get the data and manipulate it, rather than updating a div?
    thanks in advance!

  2. Jer wrote:

    Congratulations for your work !

    I'm searching how to use the option 'before' ? I have a form with differents options and i would like pass this options to the RemoteFuncion... It is possible ? Thanks for your help.

  3. Jer wrote:

    I can pass data in url option but i when i pass the value 2, my url looks like this :
    echo $javascript->codeBlock($ajax->remoteFunction(
    'url' => array('controller' => 'assistances', 'action' => 'ajax', '?' => array('parms1' => 'value', 'parms2'=>'value2')),
    'update' => 'incidents',
    'indicator' => 'loading',

  4. kvas wrote:

    AC you can define your callback function in 'success' parameter

    Jer you should try 'with' parameter, but you must give url_query string, not array

  5. Jer wrote:

    Thanks for your answer :-)

    Example of code if anyone want to use this parameter :
    echo $javascript->codeBlock($ajax->remoteFunction(
    'url' => array('controller' => 'assistances',
    'action' => 'ajax'),
    'update' => 'incidents',
    'indicator' => 'loading',
    'with' => "'var1=myvalue&var2=myvalue2'"

  6. uchida from japan wrote:

    Thanks for your support so much.
    I have some problem after settings of this one.
    This remoteFunction doesn't work for my cakephp application.
    I have an error like this.
    invalid XML markup

    Please help me and thanks in advance.

  7. mari wrote:

    hi there!

    i've been using the helper with great success so far, made things a lot easier, thanks for that. but now i'm stuck.

    i'm creating my remote function with the helper, but i need to pass a javascript variable as parameter for my url.


    'url' => array( 'controller' => 'gallery', 'action' => 'loadimage', 'IMAGEID'),
    'update' => 'galleryitem'
    )) . '}'

    where IMAGEID is a var defined in the javascript function that calls the remote function... any idea how to do this? thanks!

  8. kvas wrote:

    Hi mari,

    There is no way to do this with my helper :)

  9. mari wrote:

    bummer! I'll just copy the code it generates then and put some php tags in between :-). Thanks for anwsering and for the great helper!

  10. slim wrote:


    thk you for your work,

    I have a question,can we update more than on field in one call ? suppose we're having the same information displayed twice in the page.
    can't we have :
    'url' => array( 'controller' => 'ajax', 'action' => 'view', 1 ),
    'update' => array('post','post2')
    )); ?>


  11. kvas wrote:

    Hi slim,

    You can use it exacly as you type in your example.

  12. Jeroen Mebis wrote:

    Great helper!
    But your download page doesn't show the helper file for cakephp 2.x

  13. kvas wrote:

    hi Jeroen Mebis,
    "It's working on my machine" :)

  14. Ishan Talathi wrote:

    $this->Javascript->codeblock works on first page load and after pressing Ctrl F5 in Google Chrome. However, it does not work if we refresh (F5).

    Could you please suggest a fix or an alternative ?

  15. Ishan Talathi wrote:

    In my earlier comment, I forgot to mention that text returns fine, but we are using Google Charts API and the chart shows up on Ctrl F5 and not on F5.

  16. kvas wrote:

    Hi Ishan Talathi,
    I don't know what is wrong with your code. Maybe there are errors in chrome console?

  17. coach outlet wrote:

    The Nordstrom http://www.coachfactoryonline.name Anniversary Sale is probably my favorite sale of the year, aside from finding a random amazing bag deal at a sample sale or by http://www.wwwcoachoutlet.us.com Coach Outlet Online 70% OFF.One of the biggest stressors for me, and I'm sure others, is sorting through the sale items and making sure I find not only great deals but also what I'm looking for. Lucky for you, I narrowed down some of my Coach Outlet, http://www.coachoutletstore.us.com favorite items for you!http://www.christianlouboutinoutlet.us.com

    While the http://www.beatsbydrdre.us.com Anniversary Sale is still only open to card members, it will open to http://www.ray-banpascher.com the public this Friday, July 22nd. Keep in mind this sale is not like others; these items will go http://www.ray-banoutletstore.us.com back to full price once the sale ends. So either let my picks help you http://www.wwwraybansunglasses.us.com now or wait until Friday http://www.raybanoutletsunglasses.us.org to check it all out and nab some great deals. http://www.raybanonlineoutlet.us.com Shop the entire Outlet Online - http://www.coachoutletstoress.us.com Coach Outlet sale now!http://www.louboutinoutlet.us.com

    Seeing http://www.michaelkorsoutletwebsite.us.com Coach Outlet Stores Online, http://www.coachoutletstoresonline.us.com Coach Factory Outlet anything too frequently for too long will make people sick of it, which is why some of you guys complain when we write another post concerning classic bags like the Coach Flap Bag or Hermès Birkin. Familiarity breeds contempt. http://www.us-coachoutlet.us.com Coach USA Store When it comes to handbags, "contempt" is probably too strong a word, but there comes a point in time where you're ready for a brand to acknowledge it's done all with a certain style that it can. The Marcie feels like it's ready to cycle out to me, especially when you consider the slightly different aesthetic direction of the brand's more recent offerings. http://www.chiflatironwebsite.us.com CHI Flat Iron Like a beloved football player for one of my favorite teams, I hope the http://www.coachoutletonline.us.com Coach Outlet Online Store 2016 Marcie will go out while it's still on top.http://www.clshoesoutletonline.com

    In fact, the textured material gives a very luxe and bohemian finish that correlates easily with many summer wardrobes. I especially love suede http://www.coachoutletusaonline.us.com sandals because the material takes color so well, which makes the sandals especially vivid. If you want some examples of http://www.coachfactory.name Coach Factory http://www.coach-factoryonline.us.com how to wear http://www.coachpurses.us.com them, look no further than Rosie Huntington-Whiteley and Chrissy Coach Outlet - http://www.coachfactoryonline.us.com ,Factory Outlet Online http://www.coach-factorystore.us.com Teigen.http://www.hermesbirkinoutlet.us.com

    Summer always seems to go by in the blink of an eye, but because of suede's traditional associations with cooler weather,Coach Outlet USA http://www.coachonlineoutletstore.us.com ,Coach Outlet Online these sandals will help ease the transition to fall! http://www.coachoutletonline.us Coach Outlet Online US http://www.coachfactoryoutletinc.us.com Check out our favorites http://www.giuseppezanotti.us.com Giuseppe Zanotti below.

    Even http://www.outletonlineclearance.com Coach Outlet Online Store though we are, of course, big http://www.coachfactoryoutlet-stores.us.com proponents of buying a brand new bag, sometimes you don't need a brand new bag. Maybe the budget doesn't allow for one, maybe you just got a http://www.coach-factoryoutletstores.us.com great deal at the http://www.coachoutlets.us recent seasonal sales and you're set for a http://www.coachoutletonlinesale.us.com while, maybe http://www.coach-factoryoutletstore.us.com you just don't have the itch right now--whatever the reason, it http://www.coachoutletstoreonlines.us.com happens to all of us http://www.coachoutletstorefactory.us.com sometimes. If this sounds http://www.valentinoshoes.us.com familiar to you but you'd still like to update your daily accessories for fall, http://www.valentinooutlet.org maybe we suggest a http://www.raybanoutletsonline.us.com bag charm?http://www.redbottomshoe.us.com

    Bag http://www.valentinorockstud.us.com charms are sometimes polarizing among our readers, primarily because http://www.raybansunglassoutlet.us.com some of them are extremely expensive, despite being non-functional. That doesn't have to be the case, though--we had no problem finding nearly two dozen cute, playful options, and many of them have two-digit http://www.oakleyonlineoutlet.us.com price tags. That's the great thing http://www.raybansunglassescheap.us.org about a bag charm: they don't have to http://www.rayban-outlet.us.com be serious or expensive, but they can be both or neither, depending on your opinion and personal budget.http://www.tomsoutlet.us.com

    In general, even at http://www.raybansunglassesstore.us.com the http://www.oakleyonlinestore.us.com high end, these charms http://www.ray-bansunglasses.org are much less of a commitment than a designer bag--if you use it for a season to http://www.raybanoutletsunglass.us.com make an old favorite feel new, you won't have to feel http://www.bananelouisvuitton.com wasteful if you tuck it back in your closet in a few months in favor of the next thing http://www.valentinoshoesoutlet.us.com that catches your fancy. When http://www.raybaneyeglasses.us.com that bag starts to http://www.oakleyoutlet.name feel normal, http://www.louisvuittonlv.us.com though, your charm will be right http://www.factorystoreonline.com where you left it to provide a little extra accent.http://www.sacnoirpascher.com

    Last week celebs http://www.oakleyoutletsonline.us.com partied down with http://www.ray-bansunglasses.it politics, http://www.christianlouboutinoutletonline.us.com and Gigi Hadid managed to http://www.outlet-michaelkors.us.com stay one http://www.abercrombieoutletonline.us.com step ahead of us http://www.ralphlauren-outlet.us.com with her handbag choices. http://www.sacpascherhermes.com Also, Margot Robbie has finally begun her super stylish press tour for Suicide Squad, and we expect our photo service to be pretty generous with her http://www.oakleysunglassesstore.us.com pictures for http://www.oakleysunglassoutlet.us.com the foreseeable http://www.oakleysunglassesonsale.us.com future. That's good news for Margot Robbie fans and bag lovers alike, because her handbag http://www.poloralphlaurenoutlet.us.com picks are http://www.michaelkorsfactoryoutletonline.us.com top-notch.

    Here's Orange is the New Black http://www.oakleyoutletstores.us.org star Diane Guerrero outside of the http://www.oakleyvaultsunglass.us.com Chemical Heritage Foundation Museum in http://www.oakleyoutletstores.us.com Philly with Elizabeth Banks, http://www.michaelkorsoutletonlines.us where they both attended an "anti-obesity" luncheon together. Diane is carrying a black leather Wallet on Chain Bag.

    Greetings friends and bag lovers! http://www.michaelkorsoutletsale.us.com Unbelievably, this is our last visit in July, and we hope your summer is going well. Our http://www.oakleysunglassesoutletstore.us.com members have been shopping up a storm, and we are happy once again to bring you some of the best bags and http://www.cheapoakleysunglasses.com.co conversations from the PurseForum. This week, http://www.michaelkors.us.com some nice bags from Givenchy caught our eye, and we also looked http://www.michaelkors-outletonline.us.org inside some Chanel bags and caught up with Louis Vuitton’s newest Speedy. All this and more, just for you.

    The Givenchy http://www.truereligionjeans.us.org Antigona is http://www.michaelkorsoutletonlines.us.com still one of the most popular bags in the http://www.truereligionoutletco.us.com world, and http://www.michaelkorsoutletco.us.com emiliagunawan is so impressed with her two-year old Antigona that she http://www.polosralphlauren.us.com posted a reveal, just to share the love and let our members know what a durable bag this is. We really appreciate these reviews and updates–our forum is about sharing information. Lapetite7 picked up a new bag this week: a mini Pandora Box in classic black. Also, miacostigan showed off her first Givenchy, which was a http://www.valentinoshoesoutlet.com decision made with help from her PurseForum http://www.raybanssunglasses.us.com friends.

    Somehow it's going to be http://www.michael-korsoutletonline.com August by the time we see you again on Monday, which seems impossible until http://www.tomsshoe.us.com you remember that summer always flies by as New Yorkers hurtle straight back to http://www.michaelkorsoutletsonline.us.com the inevitable winter that it feels like just ended. In the meantime, before we http://www.michaelkorsonlineoutlets.us.com progress on to the last month of summer, it's time to look back http://www.onlinemichaelkorsoutlet.us.com and see what we learned and http://www.michaelkorssoutlet.us.com enjoyed in July.

    Below, check out http://www.modeldesac.com the http://www.michaelkors-outlet-online.com five most popular posts we published this http://www.michael-kors.us.com month--your fellow readers have some very http://www.valentinorockstudshoes.us.com good taste, and we http://www.michaelkorsonline.us.com know you're not doing much at work on a summer Friday afternoon anyway.http://www.valentinoshoes.us.org

    Last http://www.valentinooutlet.us.org year http://www.pradaoutletstore.us.com for National Handbag Day, I went about reading my handbag tea leaves to figure out what http://www.true-religions.us.com your handbag choices say about you. This year, in http://www.tomsoutlet.in.net celebration of the holiday's second coming on Friday, I've returned with a new set of highly covetable bags to do the same. http://www.christian-louboutinshoes.us.com Check out the results below.

    What we’ve set out to do is http://www.tomsshoesoutletonline.in.net create an http://www.pascherportefeuille.com Birkin price list for three http://www.truereligionoutletonline.in.net of the most common leathers–Clemence, http://www.valentinoshoeswebsite.com Togo and Epsom–in the four sizes that are commonly used as women’s handbags. Right now, we’re focusing on the US, eurozone Europe, http://www.louboutinshoes.us.com the United Kingdom and Japan, http://www.christianlouboutinsale.us.com which are the http://www.hermesbag.us.com four global markets for which http://www.north-faceoutlet.us.com pricing information is http://www.beatsbydrdreheadphone.us.com most available. Below, check out our findings, pulled from both http://www.marcjacobsoutlet.us.org our PurseForum and price http://www.truereligionoutlet.us.com lists across the web.

    The information is http://www.sacportefeuillespascher.com incomplete, but we’ll be filling it in as much as possible as we find more information. If you http://www.portefeuillepascher.com know any current prices that aren’t represented below,http://www.portefeuillespascher.com please let us know in the http://www.sacblanc.com http://www.valentinoshoes.com.co comments!

    Prices Last Updated: July 2016 http://www.valentino.com.co

  18. uabiuhinike wrote:

    http://cialis-20mg-lowestprice.org/ - cialis-20mg-lowestprice.org.ankor <a href="http://5mg-generic-cialis.net/">5mg-generic-cialis.net.ankor</a> http://prednisone-20mg-buy.com/

  19. igijatujgivu wrote:

    http://cialis-20mg-lowestprice.org/ - cialis-20mg-lowestprice.org.ankor <a href="http://5mg-generic-cialis.net/">5mg-generic-cialis.net.ankor</a> http://prednisone-20mg-buy.com/

  20. aquxowenuqola wrote:

    http://cialis-20mg-lowestprice.org/ - cialis-20mg-lowestprice.org.ankor <a href="http://5mg-generic-cialis.net/">5mg-generic-cialis.net.ankor</a> http://prednisone-20mg-buy.com/

  21. EthelmiP wrote:

    все ваши мысли и реализуют их незамедлительно. Для этого индивидуалки Москвы отрабатывали свои умения
    <a href="http://www.nskfei.club/" class="postlink"> проститутки площадь маркса индивидуальный новосибирска </a>
    интим клубы

  22. EthelmiP wrote:

    с вашими вкусами и пристрастиями. Индивидуалки Москвы заставят вас отрешиться от всех забот.
    <a href="http://www.nskfei.club/" class="postlink"> проститутки 1500 заельцовский новосибирска </a>
    интим +в 261

  23. Richardneima wrote:

    <a href=http://www.sibirki.net>проститутки новосибирска</a>
    <a href=http://www.nsexy.net>проститутки новосибирска</a>
    <a href=http://www.sibirki.su>проститутки новосибирска</a>
    <a href=http://www.siblaguna.net>проститутки новосибирска</a>
    <a href=http://www.girls-nsk.net>проститутки новосибирска</a>
    <a href=http://www.nsk.sex>проститутки новосибирска</a>
    <a href=http://www.sexonsk.xxx>проститутки новосибирска</a>
    <a href=http://www.dosugsibir.ru>проститутки новосибирска</a>
    <a href=http://www.girls-nsk.biz>проститутки новосибирска</a>
    <a href=http://www.prostitutki-sochi.info>проститутки сочи</a>
    <a href=http://www.проституткисочи.рф>проститутки сочи</a>
    <a href=http://www.prostitutki-v-sochi.net>проститутки сочи</a>
    <a href=http://www.проститутки-сочи.рф>проститутки сочи</a>
    <a href=http://www.sexosochi.ru>проститутки сочи</a>

  24. Richardneima wrote:

    <a href=http://www.sibirki.net>проститутки новосибирска</a>
    <a href=http://www.nsexy.net>проститутки новосибирска</a>
    <a href=http://www.sibirki.su>проститутки новосибирска</a>
    <a href=http://www.siblaguna.net>проститутки новосибирска</a>
    <a href=http://www.girls-nsk.net>проститутки новосибирска</a>
    <a href=http://www.nsk.sex>проститутки новосибирска</a>
    <a href=http://www.sexonsk.xxx>проститутки новосибирска</a>
    <a href=http://www.dosugsibir.ru>проститутки новосибирска</a>
    <a href=http://www.girls-nsk.biz>проститутки новосибирска</a>
    <a href=http://www.prostitutki-sochi.info>проститутки сочи</a>
    <a href=http://www.проституткисочи.рф>проститутки сочи</a>
    <a href=http://www.prostitutki-v-sochi.net>проститутки сочи</a>
    <a href=http://www.проститутки-сочи.рф>проститутки сочи</a>
    <a href=http://www.sexosochi.ru>проститутки сочи</a>

  25. Jordan 4 wrote:

    http://www.nfljerseys.us/ NFL Jerseys from China

    http://www.yeezyboost350.us.com/ Yeezy Boost 350

    http://www.longchampbags.us.com/ Longchamp Outlet

    http://www.adidas-uk.org.uk/ Adidas Sale

    http://www.raybansoutlet.us/ Ray Ban Outlet

    http://www.yeezys.org/ Yeezys For Sale

    http://www.tomsoutlet-online.us.com/ Toms Outlet Online

    http://www.kade-sapde.us.com/ Kade Sapde Outlet

    http://www.adidasoutlets.us.com/ Adidas Outlet

    http://www.nike-stores.fr/ Nike Stores

    http://www.underarmouroutlet.us.com/ Under Armour Outlet

    http://www.timberlanduk.org.uk/ Timberland Boots

    http://www.jordan12.us/ Jordan 12

    http://www.yeezy-shoes.us.com/ Yeezy Shoes

    http://www.nikehuarache.us/ Nike Huarache

    http://www.kedsshoesforwomen.com/ Keds Shoes

    http://www.yeezy.com.co/ Yeezy

    http://www.nikeairmax.us/ Nike Air Max 2016

    http://www.outlettoms.us/toms-women-c-1/ Toms Outlet

    http://www.ultraboostuncaged.us/ Ultra Boost Uncaged

    http://www.mlb-jerseys.us/ MLB Jerseys

    http://www.adidas-nmds.com/ Adidas NMD

    http://www.oakleyoutlet.net.co/ Oakley Outlet

    http://www.rayban-canada.ca/ Ray Ban

    http://www.katespadeoutlets.us/ Kate Spade Outlet

    http://www.adidas-outlet.org/ Adidas Outlet

    http://www.nikeairmax-90.com/ Nike Air Max 90

    http://www.timberland-outlet.us/ Timberland Outlet

    http://www.rayban-sunglasses.ca/ Ray Ban Sunglasses

    http://www.adidas-nmd.org.uk/ Adidas NMD

    http://www.adidaseqt.com/ Adidas EQT

    http://www.ralphlaurens.org.uk/ Ralph Lauren

    http://www.jordan4.us/ Jordan 4

    http://www.cheapjordan-shoes.com/ Cheap Jordan

    http://www.adidasnmdoutlet.com/ Adidas NMD

    http://www.katespadeoutlet.us.org/ Kate Spade

    http://www.longchamp-outlet.ca/ Longchamp

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

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!