Synchronous XMLHttpRequest on the main thread is deprecated error at the end of ajax call I'm a developer on a freelancing site (the only one actually) and I'm trying to allow anonymous users to bid on a project too. For this reason, I have the following code to check whether the username the anonymous user typed exists in the database, and show them a warning if it does. Now, everything works great, except that if the username exists in the database, I get the error at the end of the post and we can't check again because all Javascript executing is halted. What am I missing?

function tubitekuz_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  switch($form_id) {
    case 'webform_client_form_97':
      $form['submitted']['kullanici_adi']['#ajax'] = array(
        'wrapper' =&gt; 'webform-client-form',
        'method' =&gt; 'replace',
        'effect' =&gt; 'fade',
        'event' =&gt; 'blur',
        'async' =&gt; 'false',
        'callback' =&gt; '_tubitekuz_check_username',
      );
      break;
    default:
      break;
  }
}

function _tubitekuz_check_username($form, &amp;$form_state) {
  $parents = $form_state['triggering_element']['#array_parents'];
  array_pop($parents);
  $element = &amp;drupal_array_get_nested_value($form, $parents);
  $exists = FALSE;
  $username = $form_state['values']['submitted']['kullanici_adi'];
  if (!empty($username)) {
    $exists = user_load_by_name($username);
  }
  if ($exists) {
    form_error($element, 'Kullanıcı adı kayıtlı, lütfen başka bir kullanıcı adı seçin');
    $error_selector = '.webform-client-form';
    $commands[] = ajax_command_replace($error_selector, theme('status_messages').drupal_render($form));
    return array('#type' =&gt; 'ajax', '#commands' =&gt; $commands);
  }
}


The error


  Synchronous XMLHttpRequest on the main thread is deprecated because of
  its detrimental effects to the end user's experience. For more help,
  check http://xhr.spec.whatwg.org/
I at least found a solution. What I did was add the below again to my webform's tpl file, because that was the one which had stopped working.

$(".messages").on("click", function() {
  $(this).hide();
});