我已经编写了下面的代码来从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