(function(){ varres=GetRequest(); varpar=res[‘index‘]; if(par!=‘gfan‘){ varua=navigator.userAgent.toLowerCase(); varcontains=function(a,b){ if(a.indexOf(b)!=-1){returntrue;} };//将下面的http://m.baidu.com改成你的wap手机版地址如http://3g.baidu.com var..
分类:
移动开发 时间:
2014-11-04 15:11:41
阅读次数:
184
清单 1. 检查浏览器支持性if (navigator.geolocation)清单 2. 单次定位请求 API void getCurrentPosition(updateLocation, optional handleLocationError, optional options);清单 3....
1.document.write("");输出语句2.JS中的注释为//3.传统的HTML文档顺序是:document->html->(head,body)4.一个浏览器窗口中的DOM顺序是:window->(navigator,screen,history,location,document)5....
分类:
编程语言 时间:
2014-11-04 12:39:45
阅读次数:
182
var ua = navigator.userAgent; if(ua.indexOf("Windows NT 5")!=-1) { alert('您使用的是win32 XP系统!');} else { alert('您使用的是Win7系统!');}
分类:
Web程序 时间:
2014-11-03 22:30:36
阅读次数:
227
一、History对象 History 对象包含用户(在浏览器窗口中)访问过的 URL。 History 对象是 window 对象的一部分,可通过 window.history 属性对其进行访问。 注释:没有应用于 History 对象的公开标准,不过所有浏...
分类:
Web程序 时间:
2014-11-03 16:39:02
阅读次数:
185
文章目录: html5 新特性 获取地理位置: 原理:包含GPS硬件的设备上,通过GPS单元可以获取精确的位置信息。如果没有,通过web IP地址分析属于那个城市那个位置。 函数举例: navigator.geolocation.getCurrentPosition(fun...
分类:
Web程序 时间:
2014-11-03 15:56:54
阅读次数:
176
setTimeout()、clearTimeout:用于设置,取消单次执行指定操作的函数;setInterval(),clearInterval():用于设置、取消每隔指定时间执行指定操作的函数。Window对象的location属性引用的是Location对象,它表示该窗口中当前显示的文档的url,并定义了方法用来使窗口载入..
function detectOS() { var sUserAgent = navigator.userAgent; var isWin = (navigator.platform == "Win32") || (navigator.pl...
分类:
编程语言 时间:
2014-11-01 20:33:58
阅读次数:
190
JS读取UserAgent信息并做判断 userAgent信息可以由navigator.userAgent拿到。例子: 如果想来判断其中内容,可以用navigator.userAgent.match()或navigator.userAgent.indexOf() // 来判断前者一般是用来判断手机....
分类:
Web程序 时间:
2014-11-01 13:23:54
阅读次数:
180
最近在做手机打开一个网址,然后定位具体的位置,本来觉得很简单的,HTML5就能解决这问题了,后来发现问题还是很多。
首先是很多安卓手机不支持HTML5,判断navigator.geolocation是true,但是就是不返回经纬度信息,查资料发现很多国行很多手机都是这样,GMS(Google Mobile Service)被阉割了。解决这种方法可以恢复网络定位。但是咱们这手机网页是...
分类:
移动开发 时间:
2014-10-31 22:11:11
阅读次数:
401