Code: Select all
header("Access-Control-Allow-Origin: *");
before
Code: Select all
header('Content-Type: application/json');
so that ajax code on different domains can still use the APIs.
Of course, there is other options such as JSONP (only GET is allowed) or directly modify the apache settings.