OK. Back to my first effort. Some progress with this:

echo '<script type="text/javascript">'."\n";
echo '<!--'."\n";
echo 'if (!window.google || !google.gears)'."\n";
echo '{'."\n";
echo 'location.href="http://gears.google.com/?action=install&message=Welcome
Please install Google Gears to enable offline
browsing&return=http://www.researchanddeliver.com";'."\n";
echo '}'."\n";
echo '// -->'."\n";
echo '</script>'."\n";

The two things that are not working are I can't include src="gears_init.js"
otherwise this snippet gets ignored and carry onto application, and after
installing gears, the if statement is not being checked subsequently. So
even if gears is installed I am taken to the Install Gears web page.

What next?
meerkat



> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> On Behalf Of meerkat
> Sent: Tuesday, March 03, 2009 5:40 PM
> To: [email protected]
> Subject: [gears-users] Re: Help Install from PHP
> 
> 
> Hello,
> I have tried another method that is still not working:
> $js = <<<EOL
> <script language="Javascript" src="gears_init.js">
>   if (!window.google || !google.gears)
>    {   location.href =
> "http://gears.google.com/?action=install&message=<Welcome! Please install
> Google Gears to Enable Offline Mode>"
> +"&return=http://localhost/impact/abc_static/test1.htm";;
>    }
> </script>
> EOL;
> 
> echo $js;
> 
> I have again tried this method with a simple alert statement and it is
> working.
> 
> Can anyone see why the if statement is being ignored?
> Thanks,
> meerkat
> 
> > -----Original Message-----
> > From: [email protected] [mailto:[email protected]]
> > On Behalf Of meerkat
> > Sent: Monday, March 02, 2009 9:11 PM
> > To: Gears Users
> > Subject: [gears-users] Install from PHP
> >
> >
> > Hello,
> >
> > I have to install Gears from a php page. I have this:
> >
> > echo '<script type="text/javascript" src="gears.init.js">'."\n";
> > echo '<!--'."\n";
> > echo 'if (!window.google || !google.gears)'."\n";
> > echo '{'."\n";
> > echo 'location.href=\"http:\\//gears.google.com\/?action=install
> > \&message\=\<Welcome\! Please install Google Gears to Enable Offline
> > Mode\>\"+\"\&return\=http:\\//localhost\/impact\/home\\/
> > index.php"'."\n";
> > echo '}'."\n";
> > echo '// -->'."\n";
> > echo '</script>'."\n";
> >
> > I have uninstalled Gears and restarted the computer but the script is
> > being ignored. No errors received.Just going on to the next page in
> > the application, not going to gears.google.com
> >
> > I have tried this:
> > echo '<script type="text/javascript">'."\n";
> > echo '<!--'."\n";
> > echo 'location.href="http://gears.google.com/?action=install";'."\n";
> > echo '// -->'."\n";
> > echo '</script>'."\n";
> >
> >
> > and it works but I need all the details in the url and the if
> > statement.
> >
> > Can anyone shed some light on why the first snippet is not working?
> > Thanks,
> > meerkat

Reply via email to