javascript - Google 财经的股票报价问题

标签 javascript html css stocks stockquotes

下面是我从 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/

相关文章:

javascript - 如何让带有图像的 HTML 按钮与文本按钮对齐?

javascript - Google map - 根据 map 当前的视点从位置数组中获取值

javascript - 从数组中删除 NaN

php - 图片上传到客户表格作为背景

html - 更改最后一个字母颜色

javascript - 使用变换比例将 div 放在 div 的中间

javascript - JS 中 [].filter 的倒数?

javascript - 类型定义文件

java - 关于如何在基于 PHP 的门户网站中访问 Java+ Xml 应用程序的说明

jquery - html 将表格单元格中的文本与不同表格单元格中的图像相匹配