error when using google.finance.Quote

43 views
Skip to first unread message

Suchira

unread,
Dec 1, 2009, 12:24:00 AM12/1/09
to Google Data Javascript Client
Hi,

I am creating a simple hello world application where I want to show
the stock quotes of certain shares using google finance api for
javascript.

But I am getting an error as google.finance.Quote is null or not an
object.The code of my file is shown below-

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/
>
<title>My Google Data API Application</title>
<Module>
<ModulePrefs title="hellofinance">
<Require feature="finance"/>
</ModulePrefs>
<script src="http://www.google.com/jsapi?
key=ABQIAAAAZld_9jFNiB1SDEPB12bCpBTwM0brOpm-
All5BF6PoaKBxRWWERRhZSyb0ajWqfjH9EUjYlnzSjdqqA" type="text/
javascript"></script>
<script type="text/javascript">
//<![CDATA[

google.setOnLoadCallback(getMyFeed);
google.load("gdata", "1");

function getMyFeed() {
var quote = new google.finance.Quote();
quote.enableDomUpdates( { 'GOOG' : '_IG_SYM1', 'AAPL' :
'_IG_SYM2',
'INTC' : '_IG_SYM3' } );
quote.getQuotes(["GOOG", "AAPL", "INTC"]);
}

//]]>
</script>
</Module>
</head>
<body>
<div id="panel"/>
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/>
</body>
</html>

How can I solve this issue?

Bobby

unread,
Dec 1, 2009, 1:41:22 AM12/1/09
to Google Data Javascript Client
There isn't a Quote class in the GData API:
http://code.google.com/apis/gdata/jsdoc/2.1/index.html

That functionality seems to belong to a different, gadgets API:
http://code.google.com/apis/finance/docs/finance-gadgets.html

That being said, you can use GData to query Google Finance for
portfolios, transactions and position data but these queries will be
specific to the logged on user's portfolio. Anyway, check the
following samples they might provide some of the functionality you're
after:
http://code.google.com/apis/finance/developers_guide_js.html#Interactive_Samples

Bobby
Reply all
Reply to author
Forward
0 new messages