So I'm making a webapplication where you can play sudoku but the back-end is in Java. I made a servlet to communicate with my Jquery trough ajax.
I'm sending my generated array (the sudoku) to my webapp with this servlet trough Ajax. But when I do a typeof it seems to be undefined. Which means I cannot do any operations with the array
This is my Ajax call:
$.ajax({
url:"/2017_S2_Group_18/API/*",
dataType:"json",
success: function(data) {
for(var i = 0; i<81;i++){
originalSudoku[i] = $(data).attr("sudokuArray")[i];
changedSudoku[i] = $(data).attr("sudokuArray")[i];
}
}
});
orginalSudoku is the array that cannot be modified and changedSudoku is the array that is going to be modified.
This is the output I get by browsing to the URL from my Ajax call.
{"sudokuArray":[7,6,8,1,9,2,3,4,5,1,9,2,4,3,5,6,7,8,4,3,5,7,6,8,9,1,2,8,7,9,2,1,3,4,5,6,2,1,3,5,4,6,7,8,9,5,4,6,8,7,9,1,2,3,9,8,1,3,2,4,5,6,7,3,2,4,6,5,7,8,9,1,6,5,7,9,8,1,2,3,4]}
How can I parse/change my type to either string or char or integer?