I am getting the Javascript error "Uncaught TypeError: Illegal invocation" when running the code
var nativeGeoloation = window.navigator.geolocation.getCurrentPosition;
nativeGeoloation(function (){ alert("ok")});
I have tried calling the code in the context of the window, but get the same error:
nativeGeoloation.call(window,function (){ alert("ok")})
The background of this question is that I am trying to access the native version of the geolocation function that has been overwritten by another javascript library (cordova)