The server suddenly stopped responding to cross-domain requests (maybe a software update on the hosting)
client (js):
Request.onload = answer; Request.open("post", "https://xxx.php", false); Request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"); Request.send(forSend); server (php):
header('Content-Type: application/json'); header('X-Content-Type-Options nosniff'); header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: POST'); header('Access-Control-Allow-Headers: Content-Type'); header('Access-Control-Allow-Credentials: true'); as a result in the console:
Failed to load https://xxx.php: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. Uncaught DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://xxx.php'. Tell me how to resolve requests or what else could be the problem?
Request.send(forSend);. Maybe there is not onlyAccess-Control-Allow-Origin, but all the rest. - Visman