I have added the header (& quot; Access-Control-Allow-Origin: * & quot;); To the backend ;);, but why does the {code...} still appear when the front-end uses js requests ...} I have added
header("Access-Control-Allow-Origin:*");
But why does the front-end still appear when using js requests?
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://nichijou.org/x. (Reason: CORS header 'Access-Control-Allow-Origin' missing). Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://nichijou.org/x. (Reason: CORS request failed).
Reply content:
I have addedheader("Access-Control-Allow-Origin:*");
But why does the front-end still appear when using js requests?
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://nichijou.org/x. (Reason: CORS header 'Access-Control-Allow-Origin' missing). Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://nichijou.org/x. (Reason: CORS request failed).
Many browsers do not support this function.*
To setAccess-Control-Allow-Origin
The normal practice isheader("Access-Control-Allow-Origin:".$_SERVER['HTTP_HOST']);
If you want to transmit cookiesAccess-Control-Allow-Credentials: true
This header is used. Specific can see the document: https://developer.mozilla.org/en-US/docs/Web/HTTP/Server-Side_Access_Control
Which browsers are listed in the version number?