0
我有很多問題從雅虎老闆YQL Json響應數據訪問任何對象。我用這個YQL Console for Boss Search Tables。無法從雅虎老闆YQL響應數據訪問對象
這裏是我做了什麼:
<!DOCTYPE HTML>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.0.3.min.js" type="text/javascript"></script>
<script type="text/javascript">
var url = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20boss.search%20where%20service%20%3D%22images%22%20AND%20count%3D%221%22%20AND%20q%3D%22iphone6%22%20AND%20ck%20%3D%20%22MYCONSUMER_KEY%22%20AND%20secret%3D%22MYCONSUMER_SECRET%22%3B&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys";
(function showPix()
{
$.getJSON(url, function (data)
{
console.log(data);
var myObj = data.results.bossresponse.images.results.result.clickurl;
$.each(myObj, function()
{
$('#pix').append(this);
});
});
})();
</script>
</head>
<body>
<div id="pix">
</div>
<button onclick="showPix();">run</button>
</body>
</html>
的執行console.log();給我一個包含圖像的對象,但我無法在屏幕上顯示圖像。它告訴我showPix是未定義的。任何幫助將不勝感激。 TIA
我想通了這一點。 – Lamine 2015-04-11 02:53:45