Created
September 20, 2016 15:28
-
-
Save leohxj/a6256b5a9acd170629b12ca391ed1f09 to your computer and use it in GitHub Desktop.
Ajax CORS
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
// Zepto CORS | |
$.ajax({ | |
type: "get", | |
url: url, | |
data: data, | |
xhrFields: { | |
withCredentials: true | |
}, | |
crossDomain: true, | |
beforeSend: function() { | |
console.log("beforeSend"); | |
}, | |
success: function(data) { | |
console.log("success"); | |
}, | |
error: function() { | |
console.log("error"); | |
}, | |
complete: function() { | |
console.log("complete"); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment