jquery looks like this
$.post('JSP/processForm.jsp', $("#Form").serialize(),
function(data){
//I want to iterate through every line in the data object returned here.
});
I searched and tried:
$.each($(data), function(key, value) {
alert(value);
});
But that did not work. I understand the response needs to be encoded into a jQuery object first.
$(data)
But i just can’t seem to find a way to iterate through every line. The jsp code is simply:
out.println("Test");
out.println("Test Email");
out.println("Test CellPhone");
out.println("305-777-5587");
A few things to note:
If you did want to continue this way, you’d need to write some javascript to split your response html at the new line. It would likely look like this (you may need to play around with it)