我是javascript的新手。以下是我正在看的内容:
在我的代码中,我正在尝试访问这些属性。我尝试了以下内容:
result.id
result["id"]
result.CardId
result.cardId
所有这些都返回null。知道如何访问这些属性吗?
这是完整的代码:
// Step 1: Get test side (this fnc is re-used several times)
function getTestSide(succeed) {
var msgPrefix = 'GET' + testMsgBase;
$.ajax({
type: 'GET',
url: testUrl,
success: function (result) {
onCallSuccess(msgPrefix);
okAsync(result.id === testSideId,
"returned key matches testSide Id.");
if (typeof succeed !== 'function') {
debugger;
start(); // no 'succeed' callback; end of the line
return;
} else {
debugger;
succeed(result);
};
},
error: function (result) { onError(result, 'whoops'); }
});
};