My question is about Javascript. I have a Callback function which receives a Position object on a successful callback.
The problem is that when I try to set the prop
have you tried setting it via the global window object?
//on Successful callback receives a Position Object
function onSuccess(position) {
var coords = position.coords;
window.x=coords; // Setting directly to an object does not work x still remains undefined after succesful callback
return coord; // Trying to set this to a global object
}
also, since you return the coordinates from the success handler, is there not another way to get this value?