ajax jumps to the background and cannot return to the view. What is returned is a whole json array
The methods written before can be used, but I don’t know why it is wrong this time, and the console does not output a new error message.
ajax:
$.ajax({
type : "post",
url : "Qtitle/findTypeTitle3",
dataType : "json",
data : {"tite" : it},
success : function(data) {
alert(11111); //能弹出
}
});
It stands to reason that it works, data has data, alert() is also triggered, but I don’t know why it still jumps to a page that outputs a json array
The Controller’s method returns JSON data, but @ResponseBody is not added to the method, so the returned JSON data jumps to another page.
Is the ajax trigger point written on the submit button?
Clear the project and run it again
It is possible that the correct json format is not returned
The returned data has other code formats
Have you added the @ResponseBody annotation? This annotation will convert the return value into json format