【发布时间】:2009-11-09 05:18:58
【问题描述】:
我是 gear 新手,我们在 web 应用程序中使用 gear 是 flow 是……
当用户分配某个任务时,用户会收到附加消息 使用静态 html 文件,在该 html 中,我们展示了分配给用户的工作 用户提交后以 html 形式创建本地数据库和 将数据保存到本地数据库,但问题是我们没有 获取 google.gears 对象 ...
function init() {
var success = false;
if (window.google && google.gears) {
try {
db = google.gears.factory.create('beta.database');
if (db) {
db.open('local');
db.execute('create table if not exists user (name varchar
(100), user_req_desc varchar(100), status varchar(100), timestamp
int)');
} catch (ex) {
setError('Could not create database: ' + ex.message);
}
}
if (!window.google || !google.gears) {
if(confirm("Gears is not installed. Do you want to install Gears
now ?")) {
location.href = "http://gears.google.com/?action=install";
}
}
google.gears 对象即将为空
gear 已安装在我的系统中。
以上代码在 goole chrome 中运行,意味着它正在 chrome 中查找 google.gear 对象。
感谢任何帮助...
【问题讨论】:
标签: javascript html google-gears offline-mode gears