Aflax and Google Gears

Written by on June 1st, 2007 in Ajax News.

Paul Colton quickly took Google Gears and created a simple example of using it from Flash, and his Aflax framework.

Kevin Lynch demonstrated an Apollo application that used Gears at the California Google Developer Day event today. You could also have applets that use the JavaScript.

JAVASCRIPT:

  1.  
  2. function displayRecentPhrases() {
  3.   var recentPhrases = [”, ”, ”];
  4.  
  5.   // We re-throw Gears exceptions to make them play nice with certain tools.
  6.   // This will be unnecessary in a future version of Gears.
  7.   try {
  8.  
  9.     // Get the 3 most recent entries. Delete any others.
  10.     var rs = db.execute(’select * from Demo order by Timestamp desc’);
  11.     var index = 0;
  12.     while (rs.isValidRow()) {
  13.       if (index <3) {
  14.         recentPhrases[index] = rs.field(0);
  15.       } else {
  16.         db.execute(’delete from Demo where Timestamp=?’, [rs.field(1)]);
  17.       }
  18.       ++index;
  19.       rs.next();
  20.     }
  21.     rs.close();
  22.  
  23.   } catch (e) {
  24.     throw new Error(e.message);
  25.   }
  26.  
  27.   MSG = recentPhrases[0];
  28.        
  29.   if (MSG == “”) MSG = “[DB Empty]“
  30. }
  31.  

Aflax Gears

Source: Ajaxian
Original Article: http://ajaxian.com/archives/aflax-and-google-gears

Leave a Reply

You must be logged in to post a comment.



Site Navigation