alert:
Basic javascript question... How can I get the data from the success handling and return a JSON object?
Is there a away that I can place this code:
function Geo() {
navigator.geolocation.getCurrentPosition(
function(position) {
I DONT WANT TO USE position here...
I want to place it in a var like so...
this.data = position; // or something similar?
},
function errorCallback(error) {
//do error handling
}
);
}
var geo = new Geo();
geo.????? how can I get that data?
I tried this but it this.data
comes back undefined
Inside a function and call that function to get the data? I want to get that data on damand and use that data to populate different fields. I can't always use that data right there and then.
var data = ???