Skip to content

Instantly share code, notes, and snippets.

@slouma2000
Created October 20, 2014 11:03
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 slouma2000/096de328758c26d99ccc to your computer and use it in GitHub Desktop.
Save slouma2000/096de328758c26d99ccc to your computer and use it in GitHub Desktop.
Ajax jQuery
var url = 'participants/save';
$.ajax({
dataType: 'json',
type: 'POST',
url: url,
cache: false,
data: {
fbid: response.id,
fullname: response.name,
firstname: response.first_name,
lastname: response.last_name,
email: response.email
},
success: function(data) {
var baseUrl = data.url;
if (data.success == true) {
window.location.href = baseUrl;
} else {
//alert("not saved");
}
},
error: function(jqXHR, textStatus, errorThrown) {
//alert("status=" + jqXHR.status);
// Une erreur s'est produite lors de la requete
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment