2013-04-18 64 views

回答

0
  1. 要访问使用.(周期)的对象的属性不是,(逗号)
  2. getCurrentPosition功能,你需要调用它(与()
  3. getCurrentPosition可能必须发出网络请求才能找出结果,因此它是异步的。你必须传递一个回调函数作为它的第一个参数。

这样的: ''

function showPositionData(result) { 
    console.log(result); 
} 
navigator.geolocation.getCurrentPosition(showPositionData); 
+0

遗憾,而在这里输入的代码,我就把 '' 而不是.. – sachin 2013-04-18 06:33:23