Pratibha --
I tried running your code on my own host and it works.  I know you already
said you have the gears_init.js file, but I would recommend rechecking that
you have it in the correct path as that is a common mistake.  Also, it would
help if you had Firebug for Firefox installed.  It is a Javascript debugger
which can help you narrow down errors.  If you add this line:
console.log(geo);
after you initialize geo, you will be able to see if the variable exists in
the Firebug console.

-Ben

2008/10/6 Pratibha <[EMAIL PROTECTED]>

>
> Hi,
>
> I am new to Google APIs and as per my requirement I am currently using
> Geolocation API. I installed the gears on my device and could
> successfully execute the sample application on geolocation api and got
> the current address on my device.
>
> Now I am trying to write my own html page which calls the geolocation
> API ,but I am stuck here and urgently need help……………
> Here is my code:-
>
> <html>
>
> <head>GEOLOCATION API</head>
>
> <body>
> <script src="gears_init.js"></script>
> <script>
> function updatePosition(position) {
> alert('Current lat/lon is: ' + position.latitude + ',' +
> position.longitude);
> }
>
>
> function handleError(positionError) {
>
>  alert('Attempt to get location failed: ' + positionError.message);
>
> }
>
>  var geo = google.gears.factory.create('beta.geolocation');
>
> alert('Hi2');
>            //
> is not displayed
>
> geo.getCurrentPosition(updatePosition, handleError);
>
> </script>
> </body>
>
> </html>
> As mentioned I have included the gears_init.js  file but still I think
> the statement
>
>  var geo = google.gears.factory.create('beta.geolocation');
> is not being executed.What may be the issue? Kindly do instruct me as
> soon as possible.
> Any pointers to this would be of great help to me.
>
>

Reply via email to