Reason: Get ID information, involving picture path, there is "\" character, resulting in JSON parsing error
Workaround: Change the return type from "JSON" to "text", when the returned data type becomes a string, replacing the string "\" with "/", there is no problem with JSON format error,
Then call Json.parse to parse into JSON format
$.ajax ({type:"GET",//How to submitURL: "Http://127.0.0.1:24010/ZKIDROnline/info",//PathData: {},//data, which is used in JSON format for transmissionDataType: ' JSON ', Success:function(data) {if(Data.ret = = 0{$.ajax ({type:"GET",//How to submitDataType: ' Text ', URL:"Http://127.0.0.1:24010/ZKIDROnline/ScanReadIdCardInfo?",//PathData: {' Op-dev ': 1, ' Cmd-url ': 4, ' common ': 1, ' Random ': 150},//data, which is used in JSON format for transmissionSuccess:function(data) {//The return data is processed accordingly according to the result data = Data.replace (/\\/g, "/"); var result = null; result = Json.parse (data); if(Result.ret = = 0) { console.log( "Get ID Data"); }Else{ Console.log("Prompt", "ID data acquisition failed") } } }); Console.log ("Get Device Data"); } Else{Console.log ("Device Data not available"); } } });
Resolves an issue where the AJAX request returned JSON could not resolve the "\" character