
Untitled
By: a guest on
Apr 25th, 2012 | syntax:
None | size: 1.17 KB | hits: 12 | expires: Never
Setting variable from within AJAX call?
int[] array = {1,2,4,5,3,5,3,5};
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
response.getWriter().write(new Gson().toJson(array));
var test2 = [];
$.post("servlet", { info: data},
function(data) {
alert(data); // this alerts what i want stored...
test2.push(3); // testing if i can add 3 to test FAILS
});
test2.push(9); //this works
test2.push(9); //this works
options.series[0].data = test2;
var test2 = [];
$.post("servlet", { info: data},
function(data) {
alert(data); // this alerts what i want stored...
test2.push(3); // testing if i can add 3 to test FAILS
alert(test2)
});
function(data){
options.series[0].data=data;
}
var test2 = [];
$.ajax({
url: "servlet",
async: false,
type: "post",
data: { info: data},
success: function(data) {
alert(data); // this alerts what i want stored...
test2.push(3); // testing if i can add 3 to test FAILS
});
});