views:

8

answers:

0

this is my code :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google AJAX Feed API - Simple Example</title>
    <script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
    <script type="text/javascript">

    google.load("feeds", "1");

    function initialize() {
      var feed = new google.feeds.Feed("http://maps.google.com/maps/ms?ie=UTF8&amp;hl=zh-CN&amp;vps=1&amp;jsv=259e&amp;msa=0&amp;output=georss&amp;msid=109685068115364659392.00048b5b630141d82b83a");

      feed.setResultFormat(google.feeds.Feed.MIXED_FORMAT);
      feed.load(function(result) {
          if (!result.error) {
            var container = document.getElementById("feed");
            for (var i = 0; i < result.feed.entries.length; i++) {
              var entry = result.feed.entries[i];
              var votesElement = google.feeds.getElementsByTagNameNS(entry.xmlNode, "http://www.georss.org/georss", "georss")[0];
              var votes = votesElement.firstChild.nodeValue;

              var div = document.createElement("div");
              div.appendChild(document.createTextNode(entry.title + " (" + votes + "votes)"));
              container.appendChild(div);
            }
          }
        });
  }
    google.setOnLoadCallback(initialize);

    </script>
  </head>
  <body>
    <div id="feed"></div>
  </body>
</html>

i want to get the geo data(like next code) using google ajax feed api "MIXED_FORMAT"

<georss:elev>0.000000</georss:elev>

but it show error:

votesElement is undefined
[Break on this error] var votes = votesElement.firstChild.nodeValue; 

so what can i do.