Here is the front desk of the console output respectively, the background return statement, the foreground of js
Here background debug debugging when can I see the data is some, but returned to the front desk with the console. The log () output is, is empty, solving
CodePudding user response:
Taiwan before and after the data type is not the same! Background return should be converted to a JSON object, front desk value can be directlyCodePudding user response:
Don't turn you direct print data, first take a look at the background to return to the original data, so no words, may be the cause of the backgroundCodePudding user response:
Look at the ajax requests in the network under the return value will be knowCodePudding user response:
First take a look at the data transfer in no and return that add @ RespondBody json annotationCodePudding user response:
DataType: 'json' query correctly if the background and can return to normal, ajax try to modify the data typeCodePudding user response:
Sweat, tools don't use,Your screenshot, click on the Network, find you initiate the request, take a look at the response data flow is what
CodePudding user response:
DataType: "json"Returns the data type of the set to json