views:

1692

answers:

2

When you obtain the lat/long values from a GPS enabled blackberry device, how do you send those values to a server via a url? By the way, I'm trying to do this in Javascript. "window.location.href=..." works fine on the iphone.

I was thinking something like this would work but it doesn't seem to:

function locationCB() {          
    window.location.href="http://www.somewebsite.com/latitude:"+blackberry.location.latitude+"/longitude:"+blackberry.location.longitude;
    return true;
}

if ( window.blackberry && blackberry.location.GPSSupported) {
     blackberry.location.onLocationUpdate("locationCB()");
     blackberry.location.setAidMode(2);
     blackberry.location.refreshLocation();
}
A: 
Max Gontar
A: 

I wish I had a better answer (still looking for it myself). However, what I DO know is that most BlackBerry's don't support JavaScript.

Good news is that it is compatible with Geolocation.

Here's a link for its variables: http://docs.blackberry.com/en/developers/deliverables/11844/Support_for_Gears_APIs_738961_11.jsp

Goo Luck!

Tal