This "pattern" works for me
<h / "> open the developer tools and try running $.ajax by putting setRequestHeader in the beforeSend method.
<?php header('Content-Type: text/html; charset=UTF-8'); header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Headers: *'); header('Access-Control-Expose-Headers: *'); header('Access-Control-Allow-Credentials: true'); ?><!doctype html> <html lang="en-US"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> </head> <body> <script defer="defer" src="https://code.jquery.com/jquery-git.js"></script> </body> </html>
taken from Exempted HTML5 and W3C Cross-Sourcing .
user257319
source share