Created
October 20, 2014 11:03
-
-
Save slouma2000/096de328758c26d99ccc to your computer and use it in GitHub Desktop.
Ajax jQuery
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
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