How do you handle two echo responses from your PHP script with $.ajax() function.Im new to ajax and my code is not working.Here's my code: form.js
$(document).ready(function(e){
$("#form").on('submit', function(e){
e.preventDefault();
var Form = new FormData(this);
$.ajax({
url: "uploader.php",
type: "POST",
data: Form,
processData: false,
contentType: false,
success:function(data){
alert(data[0]);
}
});
});
});
And my uploader.php:
echo "stuff1";
//some other code.
echo "stuff2";
Wasn't is supposed to alert "stuff1"?...instead it doesn't send the request.