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