我使用jQuery插件jQuery gelocation查找离您最近的电话号码。在我的台式PC上运行时似乎工作正常。我得到分享我的位置的提示。但是,当我尝试在设备上执行此操作时 - iOS和Android,使用各种不同的浏览器。我没有得到提示。
我做错了吗?这是jsFiddle
$(document).ready(function()
{
$.geolocation.get(
{
success: showMyPosition,
error: noLocation
}
);
function showMyPosition(position)
{
var lat = position.coords.latitude;
var long = position.coords.longitude;
$.ajax(
{
type : 'GET',
url : 'branch_search.php',
data : {lat: lat, long: long},
dataType : 'json',
success: function (data)
{
$('.tel').html(data);
}
}
)
}
function noLocation(error)
{
// No Location Supplied Or Error (Show Base)...
}
});
当我在我的设备上运行演示时,我会收到提示输入位置,所以我怀疑某处遗漏了某些东西。
由于