คำอธิบายเฉพาะทั้งหมดอยู่ในความคิดเห็นดังนั้นฉันจะไม่พูดเรื่องไร้สาระมากที่นี่เพียงแค่นำเสนอรหัส
การคัดลอกรหัสมีดังนี้:
<script type = "text/javascript">
-
* ข้อมูลเวอร์ชันเบราว์เซอร์อัจฉริยะ:
-
-
varBrowser = {
เวอร์ชัน: function () {
varu = navigator.useragent, app = navigator.Appversion;
ส่งคืนข้อมูลเวอร์ชันเบราว์เซอร์เทอร์มินัลมือถือ
ตรีศูล: U.Indexof ('ตรีศูล')> -1, // คือเคอร์เนล
Presto: U.Indexof ('Presto')> -1, // Opera Kernel
WebKit: U.Indexof ('Applewebkit')> -1, // Apple, Google Kernel
Gecko: u.indexof ('gecko')> -1 && u.indexof ('khtml') == -1, // เคอร์เนล Firefox
มือถือ: !! u.match (/applewebkit.*Mobile.*/) || !! U.Match (/applewebkit/), // เป็นเทอร์มินัลมือถือ
ios: !! u.match (// (i [^;]+; (u;)? cpu.+mac os x/), // ios terminal
Android: U.Indexof ('Android')> -1 || u.indexof ('linux')> -1, // เทอร์มินัล Android หรือเบราว์เซอร์ UC
iPhone: U.Indexof ('iPhone')> -1 || u.indexof ('mac')> -1, // เป็นเบราว์เซอร์ iphone หรือ qqhd
iPad: U.Indexof ('iPad')> -1, // คือ iPad
WebApp: U.Indexof ('Safari') == -1 // เป็นเว็บที่ควรโปรแกรมไม่มีส่วนหัวหรือล่าง
-
-
ภาษา: (navigator.browserlanguage || navigator.language) .toLowerCase ()
-
document.writeln ("ภาษา:"+เบราว์เซอร์ภาษา);
document.writeln ("เป็นเทอร์มินัลมือถือ:"+เบราว์เซอร์ Versions.mobile);
document.writeLn ("iOS terminal:"+browser.versions.ios);
document.writeln ("เทอร์มินัล Android:"+เบราว์เซอร์ Versions.android);
document.writeln ("เป็น iPhone:"+browser.versions.iphone);
document.writeln ("ไม่ว่าจะเป็น iPad:"+browser.versions.ipad);
document.writeln (navigator.useragent);
</script>
เทอร์มินัลมือถือทั่วไปของเบราว์เซอร์นั้นอยู่ที่นี่ โปรดดูพวกเขาหากคุณต้องการ