Javascript 无法从skybiometry获取数据
我试图在回调函数中获取照片的Javascript 无法从skybiometry获取数据,javascript,Javascript,我试图在回调函数中获取照片的tid,如下所示,但它不起作用 function callback(data) { drawFaces($("#conent_demo_image"), data.photos[0], true); var tid = data.photos[0].tags[0].tid; $("#tid").text(tid); } html: <div id="tid"> tid: </div>
tid
,如下所示,但它不起作用
function callback(data) {
drawFaces($("#conent_demo_image"), data.photos[0], true);
var tid = data.photos[0].tags[0].tid;
$("#tid").text(tid);
}
html:
<div id="tid">
tid:
</div>
工业贸易署:
根据它的来源,应该是这样的:
{
"RawData": "...",
"Status": 0,
"photos": [{
"url": "https://skybiometry.com/Content/Samples/one_i.jpg",
"pid": "F@0ae0deaf6994b85e751943ae2166ec27_24412177fed2f",
"width": 480,
"height": 480,
"tags": [{
"tid": "TEMP_F@0ae0deaf6994b85e751943ae012b00ab_24412177fed2f_62.29_35.62_0_1",
"recognizable": true,
"uids": [],
"label": null,
"confirmed": false,
"manual": false,
"width": 20.83,
"height": 20.83,
"center": {"x": 62.29, "y": 35.62},
"eye_left": {"x": 68.54, "y": 30.42, "confidence": 57, "id": 449},
"eye_right": {"x": 56.67, "y": 30.42, "confidence": 55, "id": 450},
"mouth_center": {"x": 62.5, "y": 42.92, "confidence": 54, "id": 615},
"nose": {"x": 63.33, "y": 37.71, "confidence": 51, "id": 403},
"yaw": -6.0,
"roll": -1.0,
"pitch": 0.0,
"attributes": {
"face": {"value": true, "confidence": 70},
"gender": {"Value": 1, "value": "female", "confidence": 75},
"glasses": {"value": false, "confidence": 81},
"dark_glasses": {"value": false, "confidence": 58},
"smiling": {"value": true, "confidence": 100},
"age_est": {"value": 16, "confidence": 50},
"mood": {"Value": 2, "value": "happy", "confidence": 76},
"lips": {"Value": 1, "value": "parted", "confidence": 100},
"eyes": {"Value": 0, "value": "open", "confidence": 87},
"neutral_mood": {"value": false, "confidence": 0},
"anger": {"value": false, "confidence": 45},
"disgust": {"value": false, "confidence": 1},
"fear": {"value": false, "confidence": 0},
"happiness": {"value": true, "confidence": 76},
"sadness": {"value": false, "confidence": 2},
"surprise": {"value": false, "confidence": 6}
},
"points": null,
"similarities": null
}]
}],
"status": "success",
"usage": {
"ResetTime": "2015-11-07T20:02:54Z",
"used": 21633,
"reset_time_text": "Sat, 7 November 2015 20:02:54 +0000",
"remaining": 78367,
"namespace_used": 0,
"limit": 100000,
"namespace_remaining": 0,
"reset_time": 1446926574,
"namespace_limit": 0
},
"operation_id": "c869d8e95f364f979dd62277810b299c"
}
您可以显示
数据的值
?@Valentin感谢您的回复,我已经找到了jquery getJSON方法的解决方案。您没有显示如何调用回调
函数,也没有给出足够的解释,说明为什么它对您不起作用。如果你自己找到了解决方案,我建议你要么把它作为一个答案贴出来,要么把这个问题关闭,如果它没有变得更完整的话。