Issue with Mac OS and AJAX in Forms I'm working on a custom field type module for a Drupal 7 project and tried to make use of Drupal's AJAX framework in forms.
For some reason not even the simplest AJAX requests work on my machine (MacBook with Mac OS Lion) whereas the same code works fine on the Linux machines of my colleagues. When I click the button that's supposed to trigger the request I also get that little blue spinner and the "Please wait..." message but nothing happens after it disappears. In Firebug I can see that it posts to /system/ajax and also sends a "200 OK" header but an empty response.

The code was something similar to this:

$element['ajax-btn'] = array(
  '#value' =&gt; t('AJAX Test'),
  '#type'  =&gt; 'button',
  '#ajax'  =&gt; array(
    'callback' =&gt; 'test_callback',
    'wrapper'  =&gt; 'ajax-test',
    'method'   =&gt; 'replace',
  )
);

$element['new-ingredients'] = array(
  '#markup' =&gt; '&lt;div id="ajax-test"&gt;test&lt;/div&gt;',
);

function test_callback($form, $form_state) {
  return array('#markup' =&gt; 'response');
}


Any ideas?
I have a colleague with a similar problem on his OS Lion machine, but not a problem on our Snow Leopard machines. I stumbled across a solution that worked for me and may work for you. I can't see this portion of your code, but the URL that you are requesting is most likely an absolute path:

http://yourwebsite.com/someFolder/somePage.html

but what you want is a relative path:

someFolder/somePage.html

AJAX requires that all requests come from the same website. This is a principle of Same Origin Policy and is done for security reasons.

If you are requesting an absolute path to a link on the same website (as you probably are doing), the system should look and see that the request is from the same domain, in which case does not break Same Origin Policy. However, the person in charge of coding Lion's AJAX Same Origin Policy has a problem with their code that does not realize this is the case, causing the browser to think you are trying to run a Cross Domain Script. Hopefully they will realize this soon and fix it in the next update.