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:
-
-
function displayRecentPhrases() {
-
var recentPhrases = [”, ”, ”];
-
-
// We re-throw Gears exceptions to make them play nice with certain tools.
-
// This will be unnecessary in a future version of Gears.
-
try {
-
-
// Get the 3 most recent entries. Delete any others.
-
var rs = db.execute(’select * from Demo order by Timestamp desc’);
-
var index = 0;
-
while (rs.isValidRow()) {
-
if (index <3) {
-
recentPhrases[index] = rs.field(0);
-
} else {
-
db.execute(’delete from Demo where Timestamp=?’, [rs.field(1)]);
-
}
-
++index;
-
rs.next();
-
}
-
rs.close();
-
-
} catch (e) {
-
throw new Error(e.message);
-
}
-
-
MSG = recentPhrases[0];
-
-
if (MSG == “”) MSG = “[DB Empty]“
-
}
-
Source: Ajaxian
Original Article: http://ajaxian.com/archives/aflax-and-google-gears