PHP side has header ("access-control-allow-origin:*");
Ajax requests
$.ajax( { type : "post", url : url, async : false, dataType: 'json', data : {asdsa:1}, success : function (obj) { //业务代码 }, error : function (obj) { alert('未找到文件'); } } );
Data emptying such as {} On Error cors header missing ' access-control-allow-origin '
Data write a random parameter such as {dasdsa:1} is normal, what is the matter?
Cross-domain access does not occur when there is no domain name binding on the test machine, and now it is not possible to bind the domain name online
PS. Test and on-line there is a different, testing the back end of the Apache, on-line backend with Nginx, and this has a relationship?
Reply content:
PHP side has header ("access-control-allow-origin:*");
Ajax requests
$.ajax( { type : "post", url : url, async : false, dataType: 'json', data : {asdsa:1}, success : function (obj) { //业务代码 }, error : function (obj) { alert('未找到文件'); } } );
Data emptying such as {} On Error cors header missing ' access-control-allow-origin '
Data write a random parameter such as {dasdsa:1} is normal, what is the matter?
Cross-domain access does not occur when there is no domain name binding on the test machine, and now it is not possible to bind the domain name online
PS. Test and on-line there is a different, testing the back end of the Apache, on-line backend with Nginx, and this has a relationship?
Don't know what you're talking about across domains, Ajax can only be active within the root directory.
It feels like an Ajax cache problem, and the other cross-domain should be jsonp.
Is there a server-side error or a client error in the network?