How to get the current location,mouse position and current url using javascript browser detect -
i'm creating tool monitor website.
for need current location, mouse position, , current url using javascript browser detection
how can this?
i know code below correct getting current position.
var loc = navigator.geolocation.getcurrentposition; console.log(loc);
- to access property of object use
.
(period) not,
(comma) getcurrentposition
function, need call (with()
)getcurrentposition
may have make network requests in order figure out result, asynchronous. have pass callback function first argument.
such:
function showpositiondata(result) { console.log(result); } navigator.geolocation.getcurrentposition(showpositiondata);
Comments
Post a Comment