Created
May 28, 2018 18:19
-
-
Save b13bs/a763fcf194d9299488f2a8a290786f42 to your computer and use it in GitHub Desktop.
CORS snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var script = document.createElement('script');script.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js";document.getElementsByTagName('head')[0].appendChild(script); | |
$.ajax({ | |
url: "https://fullurl-api.test", | |
type: "OPTIONS", | |
complete: function(result, status) { | |
console.log(status) | |
console.log(result) | |
} | |
}); | |
$.ajax({ | |
url: "https://fullurl-api.test", | |
type: "GET", | |
data: "param=value", | |
complete: function(result, status) { | |
console.log(status) | |
console.log(result) | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment