Base diving with Gears

Written by on June 22nd, 2007 in Ajax News.

Pamela Fox and I have published our first article in a series on Building Ajax Applications with Google APIs.

The first article is on Base diving with Google Gears.

We took Google Base and created a simple offline application that stores search results. We use the JSON API and store away the feeds in the local offline store.

To enable offline and online we created two implementations of the content interface. One reads from the local store, and grabs results when needed. The other keeps the search terms in a cookie, and always hits the GData store for its info.

In related news… GSpreadsheet wraps the Google Spreadsheet API. There is some really “interesting” code in there to handle getting the data back asynchronously, involving creating functions on the fly to use in the callback.

Using it looks like this:

JAVASCRIPT:

  1.  
  2. GSpreadsheet.load(”pSYwzniwpzSFnt8Ix3ohQQA”, { index: ‘firstname’ }, function(gs) {
  3.   // display all
  4.   document.getElementById(”displayall”).innerHTML = gs.displayAll();
  5.      
  6.   // show one
  7.   var row = gs.select(’Bob’);
  8.   document.getElementById(”onebyindex”).innerHTML = row.email;
  9.  
  10.   // show by row number
  11.   row = gs.select(1);
  12.   document.getElementById(”onebyrownum”).innerHTML = row.email;
  13.      
  14.   // display one row
  15.   document.getElementById(”displayrow”).innerHTML = gs.displayRow(’Bob’);
  16. });
  17.  

Source: Ajaxian
Original Article: http://feeds.feedburner.com/~r/ajaxian/~3/126924242/base-diving-with-gears

Leave a Reply

You must be logged in to post a comment.



Site Navigation

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35