我正在尝试使用下面的代码打印 Google 最后的引号。问题是它只打印 1 个报价,而且它似乎停止运行。这里可能有什么问题?谢谢丹尼
<script type="text/javascript">
$(document).ready(function(){
var symbol = 'goog';
var url = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22"+symbol+"%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env&format=json";
while (1 == 1) {
var jqxhr = $.getJSON(url, function (json)
{
var lastquote = json.query.results.quote.LastTradePriceOnly;
document.write("lastquote = " + lastquote + "<br>");
})
.done(function() {
document.write( "success<br>" );
})
.fail(function() {
document.write( "error<br>" );
})
.always(function() {S
document.write( "complete<br>" );
});
}
});
</script>