增加设备检测页面
This commit is contained in:
parent
416086b350
commit
8d287a4eb3
|
@ -181,6 +181,7 @@
|
||||||
<Content Include="Content\js\Longbow.Common.js" />
|
<Content Include="Content\js\Longbow.Common.js" />
|
||||||
<Content Include="Content\js\messages_zh.js" />
|
<Content Include="Content\js\messages_zh.js" />
|
||||||
<Content Include="Content\js\messages_zh.min.js" />
|
<Content Include="Content\js\messages_zh.min.js" />
|
||||||
|
<Content Include="DeviceTest.htm" />
|
||||||
<Content Include="Scripts\Content.js" />
|
<Content Include="Scripts\Content.js" />
|
||||||
<Content Include="Scripts\Dicts.js" />
|
<Content Include="Scripts\Dicts.js" />
|
||||||
<Content Include="Scripts\Exceptions.js" />
|
<Content Include="Scripts\Exceptions.js" />
|
||||||
|
|
|
@ -89,6 +89,27 @@
|
||||||
window.console = window.console || {};
|
window.console = window.console || {};
|
||||||
console.log || (console.log = opera.postError);
|
console.log || (console.log = opera.postError);
|
||||||
|
|
||||||
|
// client
|
||||||
|
jQuery.browser = {
|
||||||
|
versions: function () {
|
||||||
|
var u = navigator.userAgent;
|
||||||
|
return { //移动终端浏览器版本信息
|
||||||
|
trident: u.indexOf('Trident') > -1, //IE内核
|
||||||
|
presto: u.indexOf('Presto') > -1, //opera内核
|
||||||
|
webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
|
||||||
|
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
|
||||||
|
mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
|
||||||
|
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
|
||||||
|
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
|
||||||
|
iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
|
||||||
|
iPod: u.indexOf('iPod') > -1, //是否为iPod或者QQHD浏览器
|
||||||
|
iPad: u.indexOf('iPad') > -1, //是否iPad
|
||||||
|
webApp: u.indexOf('Safari') == -1 //是否web应该程序,没有头部与底部
|
||||||
|
};
|
||||||
|
}(),
|
||||||
|
language: (navigator.browserLanguage || navigator.language).toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
$.fn.extend({
|
$.fn.extend({
|
||||||
autoCenter: function () {
|
autoCenter: function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<script src="Content/js/jquery-1.10.2.js"></script>
|
||||||
|
<script src="Content/js/Longbow.Common.js"></script>
|
||||||
|
<script>
|
||||||
|
var browser = $.browser;
|
||||||
|
document.writeln("语言版本:" + browser.language + "</br>");
|
||||||
|
document.writeln("是否为移动终端:" + browser.versions.mobile + "</br>");
|
||||||
|
document.writeln("ios终端:" + browser.versions.ios + "</br>");
|
||||||
|
document.writeln("android终端:" + browser.versions.android + "</br>");
|
||||||
|
document.writeln("是否为iPhone:" + browser.versions.iPhone + "</br>");
|
||||||
|
document.writeln("是否iPad:" + browser.versions.iPad + "</br>");
|
||||||
|
document.writeln(navigator.userAgent);
|
||||||
|
document.writeln(JSON.stringify(browser.versions));
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue