Created
September 27, 2022 08:54
-
-
Save shrekuu/d38e0d0a1f2dbfd5ab08bf8525b6d96c to your computer and use it in GitHub Desktop.
jquery CORS request example
This file contains hidden or 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
return $.ajax({ | |
url: 'https://another-domain.com/api/user/', | |
type: 'GET', | |
dataType: 'json', | |
xhrFields: { | |
withCredentials: true, // this line is required | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment