Skip to content

Instantly share code, notes, and snippets.

@mtinra
Last active May 2, 2019 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtinra/7c9a8abf8d67960da39d62de67a5c09b to your computer and use it in GitHub Desktop.
Save mtinra/7c9a8abf8d67960da39d62de67a5c09b to your computer and use it in GitHub Desktop.
XMLHttpRequest for CORS
<script>
const request = new XMLHttpRequest();
const url = 'https://www.google.co.th/';
function CORSTesting() {
if(request) {
request.open('GET', url, true);
request.send();
}
}
CORSTesting();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment