【问题标题】:getting null for google.gears object when working offline离线工作时 google.gears 对象为空
【发布时间】: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";
    }
 }
  1. google.gears 对象即将为空

  2. gear 已安装在我的系统中。

  3. 以上代码在 goole chrome 中运行,意味着它正在 chrome 中查找 google.gear 对象。

感谢任何帮助...

【问题讨论】:

    标签: javascript html google-gears offline-mode gears


    【解决方案1】:

    很抱歉,问题是我没有包含 gears_init.js,但它也与 google chrome 一起使用......

    包含 gears_init.js 文件后,它工作正常...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-27
      • 2015-06-12
      • 2016-07-26
      • 1970-01-01
      • 1970-01-01
      • 2015-02-14
      • 2021-08-27
      • 2019-07-13
      相关资源
      最近更新 更多