I have this code:
$.ajax({
type: "POST",
data: JSON.stringify(formData),
dataType: "json",
url: "http://www.test.com/users/" + get_back + "",
success: function(t){
alert(t);
}
});
I was wondering how can I POST to multiple links? Do I have to create another $.ajax POST or can I just add more url fields into the same POST?
Thanks
You have to do it multiple times, one for each URL you want to send to. But there are shortcuts:
We are putting all the URLs you want to POST to in a JavaScript Array and then using jQuery’s $.each to iterate through them and do an AJAX POST to each one.