title: Access Wordpress ajax on external host
body: <p>I'm building this HTML/JS app to turn into mobile with Phonegap that is based on my wordpress site (using its database, users, etc.).
  So right now I have an index.html with a functions.js that tries to access a function created on my wordpress like </p>
  
  <pre><code>add_action('wp_ajax_nopriv_checking_email', 'checking_email');
  </code></pre>
  
  <p>what I want is to be able to access this with my JS code.
  I've tried something like this:</p>
  
  <pre><code>jQuery.ajax({
      type: 'POST',
      url: 'http://myhost.com/wp-admin/admin-ajax.php',
      data: { 'action': 'checking_email', 'email': 'email@example.com' },
      success: function(request_data) {
          console.log(request_data);
      }
  });
  </code></pre>
  
  <p>and I get </p>
  
  <p><code>XMLHttpRequest cannot load http://myhost.com/wp-admin/admin-ajax.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.</code></p>
  
  <p>What can I do to access admin-ajax.php from an external host?</p>