Google 财经的股票报价出现问题
以下是我从谷歌财经获得的股票报价示例。但它似乎不起作用。不显示股票价格。
谢谢
<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>
Below is the example I got from google finance for a stock quote. But it doesnt seem to be working. Stock price isnt displayed.
Thanks
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您似乎正在使用 http://code 中的示例.google.com/apis/finance/docs/finance-gadgets.html#JS_API 。如果我理解正确的话,该 API 仅适用于小工具。它说,
常规 Google Finance JS API 仅允许您获取与用户的投资组合相关的数据。
It looks like you are using the example at http://code.google.com/apis/finance/docs/finance-gadgets.html#JS_API . If I understand right, that API is only available to gadgets. It says,
The regular Google Finance JS API only allows you to get data associated with a user's portfolio.
您可能需要首先对 Google 财经服务进行身份验证。
AuthSubRequest URL 可能如下所示:
http://code。 google.com/apis/finance/docs/2.0/developers_guide_protocol.html#Authenticating
You probably need Authenticating to the Google Finance service first.
The AuthSubRequest URL might look like this:
http://code.google.com/apis/finance/docs/2.0/developers_guide_protocol.html#Authenticating
您是否尝试过用引号将 span id 属性括起来?
Have you tried surrounding the span id attributes with quotes?