我已经通过几个同样的问题也消失了,但没有人可以给我的理解是什么在我的代码正在发生的事情。我的代码是:代码在Firefox工作正常,无法在Chrome
if (navigator.geolocation) {
console.log(" in navigator If");
navigator.geolocation.getCurrentPosition(showPosition, null, {
enableHighAccuracy : true,
maximumAge : 1000,
timeout : 0
});
} else {
console.log("in Navigator else");
alert("Browser doesn't support location detection. Please pass latitude & longitude for current location in URL. Thanks.");
}
此代码工作在Firefox罚款,但不是在铬 我使用的是Mac,Jboss的。 在Chrome控制中没有任何条件(既不,如果,也不是)
你在Chrome控制台中得到了什么样的错误信息(如果有的话)? – noj
@jonnynnoj:没有错误控制台,甚至不问铬权限的位置.. – umesh
只是测试它和我的“在导航如果”的消息,所以你的问题是在其他地方。 – noj