はじめに gears_init.js をロードするようにします。gears_init.js は Getting Started with Google Gears からダウンロードできます。
<script src="gears_init.js"></script>次に Google Gears オブジェクトの存在を確認します。Google Gears オブジェクトが存在しないとき、Google Gears はインストールされていなことを意味します。Google Gears オブジェクトが存在しないときは、次のように Google Gears のインストールを促すページに遷移させます。
<script>action パラメータに install を指定すると、Google Gears のインストールを促すページに遷移します。このとき message パラメータの値がメッセージとして表示されます。
//<![CDATA[
// install Google Gears Beta
if (!window.google || !google.gears) {
location.href = 'http://gears.google.com/?' +
$H({
action: 'install',
message: 'Feed Reader のご利用には Google Gears が必要です。',
'return': location.href
}).toQueryString();
}
//]]>
</script>

Install Google Gears Beta ボタンをクリックして Google Gears のインストーラをダウンロードできます。このとき return パラメータの値がインストール後の戻り先の URL として表示されます。

現状 Google Gears のインストールの説明は英語のみのようです。日本語じゃないのが残念です。
![]() | Google Gearsスタートガイド 白石 俊平 ![]() ![]() ![]() ![]() ![]() by G-Tools |
0 件のコメント:
コメントを投稿