title: How to setup a JS client to perform a remote API request?
body: <p>What I am trying to achieve:<br>
  To be able to embed the below code on a client domain, let's say client.com which makes a call to the apidomain.com. The client.js script on the apidomain makes an ajax call to a PHP file app.php which is also hosted on apidomain.com. Once the call is made, options are applied and the PHP file responds with the data which is embedded on the client side page.<br>
      <code>&lt;script type="text/javascript" src="http://apidomain.com/client.js"&gt;
       var api_key = 'key';
       var opts = true;
      &lt;/script&gt;</code></p>
  
  <p>I have the JS and the PHP setup, however everytime the client.js makes a request to the app.php it returns blank, even though the post data goes through. Is this problem related to cross domain ajax request? What would be the correct setup?</p>