 <pre><code> In the PHP part you need add two more headers : header("Access-Control-Allow-Origin: *"); header('Access-Control-Allow-Methods: GET, POST'); Add the two line of coding with the: header('Content-Type: application/json'); change the: echo (json_encode($data)); to: print $my_json = json_encode($data); or: print_r ($my_json); Hope it will work. </code></pre>