我需要使用jQuery Ajax将value / s(Windows路径)传输到json,以便将值抛出或解码为PHP脚本,但无法在json中使用反斜杠读取value / s。必须将其转换为带有反斜杠的完整路径的json值。
我的示例代码:
/*==========================================================================*/
var file_name = "C:\WINDOWS\Temp\phpABD.tmp";
var jsonSearchContent = "{\"file_name\":\""+file_name+"\"}";
$.ajax({
type:"POST",
dataType: "html",
url: url,
data: {sendValue:jsonSearchContent},
complete: function (upload) {
alert(upload.responseText);
}
}
);
/*==========================================================================*/
Run Code Online (Sandbox Code Playgroud)
提前致谢。