I make an AJAX post request to get processed data from DB in form of "array" [value1, value2, value3,...,valueN] to later use it on a chartJS object.
AJAX Request:
$(document).ready($.post('callMeForAJAX.jsp', function(data){
values = data;
console.log(data);
}));
But it doesn't print anything on the console even though I can see the response on the "Network" tab on the Development Tools from Chrome.
How can I retrieve that data (isn't more than a String) to put it on the "data" parameter of the Chart object?
callMeForAJAX.jsp:
<%@ page contentType="text/xml;charset=UTF-8"%>
<%
String data = "[";
for(String s : InfoFacade.getData()){
data += s+", ";
}
data += "]";
response.getWriter().write(data);
%>
Edit: If relevant, I was using 1.2.x jQuery lib and now I have upgraded to 2.x without any changes.