没有SSL连接的HTML5地理位置
HTML5Geolocation用于查找用户的位置。可以没有SSL连接。这可以生成如下-
// Variable apigeo shows successful location:
var apigeo = function(position) {
alert("API geolocation success!\n\nlat = " + position.coords.latitude + "\nlng = " + position.coords.longitude);
};
var tryapigeo = function() {
jQuery.post( "check the location on google map", function(success) {
apiGeolocationSuccess({coords: {latitude: success.location.lat, longitude: success.location.lng}});
}) //Gives success on given geolocation
.failure(function(err) { //On failure, alert with failure is shown
alert("error while showing geolocation! \n\n"+err);
});
};然后可以生成用于错误代码的各种开关情况,用于不同错误的不同错误代码。
var tryloc = function() {//tryloc variable show current position
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
browserGeolocationSuccess, browserGeolocationFail,{
maximumAge: 70000, timeout: 40000, enableHighAccuracy: true});
/ /this will show result with high accuracy
}};热门推荐
10 祝福语简短创意闺蜜
11 团体年会祝福语简短霸气
12 朋友祝福语两字简短
13 新年发给客户祝福语简短
14 宝宝100日简短祝福语
15 朋友节最简短祝福语
16 新婚祝福语大全简短经典
17 贺卡文字同事祝福语简短
18 送给同桌的祝福语简短