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); 

  1. to access property of object use . (period) not , (comma)
  2. getcurrentposition function, need call (with ())
  3. 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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -