Ajax cross domain issues solved easily with PHP
Posted: Sun Jun 28, 2015 12:06 am
In PHP you set the following:
before
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.
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.