Skip to content

Instantly share code, notes, and snippets.

@dayvsonlima
Created September 21, 2016 03:37
Show Gist options
  • Select an option

  • Save dayvsonlima/2ec663a7f4dc811f879a89d5f3d7320c to your computer and use it in GitHub Desktop.

Select an option

Save dayvsonlima/2ec663a7f4dc811f879a89d5f3d7320c to your computer and use it in GitHub Desktop.
Ajax cross subdomain
$.ajax("http://domain.local:3000/resource", {
method: 'GET',
xhrFields: { withCredentials: true },
crossDomain: true,
success: function(data){ console.log(data) },
error: function(data){ console.log('deu ruim') }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment