if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(pos) { model.address.geo = { lat: pos.coords.latitude.toFixed(5), lng: pos.coords.longitude.toFixed(5) }; }); } else { alert("Geolocation is not supported by this browser.
1.js 判断IOS版本号 先来观察 iOS 的 User-Agent 串: iPhone 4.3.2 系统:Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5iPone 5.1 系统:Mozilla/5.0 (iPhone; U; CPU iPhone
/*========================================= 函数功能:获取浏览器类型 =========================================*/ function getBrowser() { var type = "pc" var ua = navigator.userAgent.toLowerCase(); /* Navigator 是HTML DOM中的内置对象,它包含有关浏览器的信息.userAgent是Navigator