相关疑难解决方法(0)

Safari 5中的地理位置

我有一个使用HTML5地理位置报告我的位置的应用程序.该应用程序在Firefox和Chrome上运行正常,但在Safari 5上,它表示Safari不支持Geolocation.

从我读到的,Safari 5确实支持Geolocation.我错过了什么?

谢谢你的时间.

苏尼尔

safari html5 geolocation

12
推荐指数
1
解决办法
3万
查看次数

W3C地理定位API无法在Safari 5上运行

W3C地理位置API似乎在safari 5中不起作用.我尝试了这个页面,它告诉我Geolocation不成功.

代码:http: //code.google.com/apis/maps/documentation/javascript/examples/map-geolocation.html

有人可以解释一下为什么会这样吗?

w3c google-maps geolocation

7
推荐指数
2
解决办法
7170
查看次数

html5地理定位不适用于Safari浏览器

致力于html5地理定位.

尝试过mozilla,chrome,IE.他们工作正常,但没有为野生动物园工作.在Mac上的safari(8.0.5)上进行测试,在windows上使用safari(5.1)进行测试

只需点击网址

http://www.w3schools.com/html/html5_geolocation.asp
Run Code Online (Sandbox Code Playgroud)

要么

http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation

  <!DOCTYPE html>
<html>
<body>

<p>Click the button to get your coordinates.</p>

<button onclick="getLocation()">Try It</button>

<p id="demo"></p>

<script>
var x = document.getElementById("demo");

function getLocation() {
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(showPosition);
    } else { 
        x.innerHTML = "Geolocation is not supported by this browser.";
    }
}

function showPosition(position) {
    x.innerHTML = "Latitude: " + position.coords.latitude + 
    "<br>Longitude: " + position.coords.longitude;  
}
</script>

</body>
</html>
Run Code Online (Sandbox Code Playgroud)

它允许弹出允许/禁止但在允许后不执行任何操作.我已经在Mac上测试了与wi-fi连接的Safari,但不适用于wi-fi和LAN上的笔记本电脑.

html javascript windows safari geolocation

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

geolocation ×3

safari ×2

google-maps ×1

html ×1

html5 ×1

javascript ×1

w3c ×1

windows ×1