1.js Get Browser Info: Contains information about whether the mobile side, and browser info, Android version
2.js get page URL, domain, title
function Browserinfo () {var browser = {Versions:function () {var u = Window.navigator.useragent;//android version var num;if (U. IndexOf (' Trident ') >-1) {//iereturn "IE";} else if (U.indexof (' Presto ') >-1) {//operareturn "Opera";} else if (u.i Ndexof (' Gecko ') >-1 && u.indexof (' khtml ') = =-1) {//firefoxreturn "Firefox";} else if (U.indexof (' AppleWebKit ' && u.indexof (' Safari ') >-1) >-1) {//Apple, Google kernel if (u.indexof (' Chrome ') >-1) {//chromereturn "Chrome";} E LSE if (U.indexof (' OPR ')) {//webkit Operareturn "Opera_webkit"} else {//safarireturn "Safari";}} else if (U.indexof (' mobile ') >-1) {//Mobile if (!! U.match (/\ (i[^;] +;( U;)? Cpu.+mac OS x/) {//iosif (u.indexof (' iphone ') >-1) {//iphonereturn "iphone"} else if (U.indexof (' IPod ') >-1) {//i Podreturn "IPod"} else if (U.indexof (' ipad ') >-1) {//ipadreturn "ipad"}} else if (U.indexof (' Android ') > -1| | u.ind Exof (' Linux ') >-1) {//androidnum = U.substr (U.indexof (' Android ') + 8, 3); return {"Type": "anDroid "," Version ": num};} else if (u.indexof (' BB10 ') >-1) {//BlackBerry BB10 system return "BB10";} else if (U.indexof (' Iemobile ')) {//windows Phonereturn "Win dows Phone "}}}}//browser version var browservsersion = Browser.versions ();//current page path var url = window.location.href;//Current page domain name var host = window.location.host;//Current page domain name Var host2=document.domain; alert (host2);//Current page title var title = document.title;//Source Address Urlvar referer;if (document.referrer.length > 0) {referer = Document.referrer;} try {if (Referer.length = = 0 && opener.location.href.length > 0) {referer = Opener.location.href;}} catch (e) { Referer = window.location.href;} Current page Source urlreferer = Referer.replace (' http://', ');}
My personal blog: http://blog.caicongyang.com;
My personal website: http://www.caicongyang.com;
My csdn blog address: Http://blog.csdn.net/caicongyang;
JS get browser information and page information