[development] Passing a client value back to Drupal

jeff at ayendesigns.com jeff at ayendesigns.com
Wed Mar 30 00:12:04 UTC 2011


That's the clean way to do it, and I would if I were in control of the 
handshaking, but because Ctools is doing the handling of the link click 
and the construction of the AJAX handshaking, I can't just package it up 
and send it...I need to find the right 'box and forms' to get it to 
accept, carry and deliver my package for me.

On 03/29/2011 07:49 PM, Anthony Malkoun wrote:

> I don't use CTools, but how I normally do this is define in the module 
> a hook_menu item that is purely callback (i.e. 'type' => 
> MENU_CALLBACK) and use that.  Tabular data I push using a jQuery 
> $.ajax call and just serialize() the whole data HTML element.  To pass 
> something back in the callback function (in module) just encode it 
> using json_encode and in jQuery $.ajax call have a success handler 
> that does something with it.
>
> Malks.
>


More information about the development mailing list