下面是我从 google finance 获得的股票报价示例。但它似乎没有用。未显示股票价格。
谢谢
<body>
Hello world!
Here is your portfolio:<br/>
GOOG: <span id=_IG_SYM1_l></span> (<span id=_IG_SYM1_c></span>)<br/>
AAPL: <span id=_IG_SYM2_l></span> (<span id=_IG_SYM2_c></span>)<br/>
INTC: <span id=_IG_SYM3_l></span> (<span id=_IG_SYM3_c></span>)<br/>
<script type="text/javascript">
var quote = new google.finance.Quote();
quote.enableDomUpdates( { 'GOOG' : '_IG_SYM1', 'AAPL' : '_IG_SYM2',
'INTC' : '_IG_SYM3' } );
quote.getQuotes(["GOOG", "AAPL", "INTC"]);
</script>
<!-- start: javascripts -->
<!-- end: javascripts -->
</body>
最佳答案
看起来您正在使用 http://code.google.com/apis/finance/docs/finance-gadgets.html#JS_API 中的示例.如果我理解正确的话,该 API 仅适用于小工具。它说,
"Gadgets that use the Market Data API can only run in iGoogle--either production iGoogle, or the iGoogle sandbox."
regular Google Finance JS API只允许您获取与用户的投资组合相关的数据。
关于javascript - Google 财经的股票报价问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2192918/