I've been playing with the new ajax framework and have successfully used it for the admin form on the D7 version of Quicktabs - awesome stuff, the ajax callback is so simple! :-)
Anyway, I was also testing the use of the 'use-ajax' class to do just a regular ajax request when clicking on a link. My menu callback calls ajax_deliver() as long as ajax is passed in and not nojs. I can get this to work only by hacking ajax.js to tell it what element.wrapper and element.click should be, otherwise it causes a js error as these properties are missing and I can't figure out how to set them from the php side. I, perhaps naively, thought that something like this should work:
$build['ajaxy_link'] = array( '#type' => 'link', '#title' => t('Click here'), '#href' => 'ajaxy/nojs/', '#attributes' => array('class' => array('use-ajax')), '#ajax' => array( 'event' => 'click', 'wrapper' => 'content', ), );
Anyway, this does not load ajax.js on the page and does not communicate the wrapper and event properties as required. It would be great if someone who understands how this should work could either add the explanation to the existing docs or give a brief instruction in this thread and I'll write it up in the docs.
PASSED: [[SimpleTest]]: [MySQL] 17,384 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 17,385 pass(es). View
Unable to apply patch ajax_links.patch View