我已經編寫了下面的代碼來從webservice獲取JSON結果。如何獲取JSON密鑰和值?
function SaveUploadedDataInDB(fileName) {
$.ajax({
type: "POST",
url: "SaveData.asmx/SaveFileData",
data: "{'FileName':'" + fileName + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
var result = jQuery.parseJSON(response.d);
//I would like to print KEY and VALUE here.. for example
console.log(key+ ':' + value)
//Addess : D-14 and so on..
}
});
}
下面是從web服務響應:
請幫我打印鍵,它的價值
FWIW,您在第一個片段末尾缺少右括號。 – BWDesign