javascript - Uncaught SyntaxError: Unexpected token d -
hi i'm sending integer array spring mvc controller method.when passed data getting controller , functionality working good. after function controller send response client side, on client side response data goes error function , showing
uncaught syntaxerror: unexpected token d $.ajax({ type : 'get', datatype : 'json', url : 'deleteteacherselectednotes.html', data : ({ notes : json.stringify(notearray) }), success : function(responsedata) { stoppreloader(); }, error: function (response) { var r = jquery.parsejson(response.responsetext); console.log("message: " + r.message); console.log("stacktrace: " + r.stacktrace); console.log("exceptiontype: " + r.exceptiontype); } }); @requestmapping(value = "/deleteteacherselectednotes.html", method = requestmethod.get) @responsebody public boolean deleteteacherselectednotes(@requestparam("notes")string notes) throws jsonexception{ jsonarray arrjson = new jsonarray(notes); (int = 0; < arrjson.length(); i++) { string x = arrjson.getstring(i); noteservice.deletenote(integer.parseint(x)); } return false; }
try changing data type json
$.ajax({ type : 'get', datatype : 'json', url : 'deleteteacherselectednotes.html', data : ({ notes : json.stringify(notearray) }), success : function(responsedata) { stoppreloader(); }, error: function (response) { var r = jquery.parsejson(response.responsetext); console.log("message: " + r.message); console.log("stacktrace: " + r.stacktrace); console.log("exceptiontype: " + r.exceptiontype); } });
Comments
Post a Comment