<script> (function () { var navUA = navigator.userAgent; var defIncludeStr = "iPhone|Android|iPod|BlackBerry|"; var defExcludeStr = ""; var redirectUrl = ""; var metas = document.getElementsByTagName("meta");…
第一种,只区分浏览器,不考虑版本 function myBrowser(){ var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 var isOpera = userAgent.indexOf("Opera") > -1; if (isOpera){return "Opera"}; //判断是否Opera浏览器 if (userAgent.indexOf("Firefox")…
var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器 var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 if(isAndroid){ android(); function android(){ window.location.href…
The JavaScript specification gives exactly one proper way to determine the class of an object: Object.prototype.toString.call(t); http://bonsaiden.github.com/JavaScript-Garden/#types https://stackoverflow.com/questions/7893776/the-most-accurate-way-t…
var video_src_file = $("#video_src_file").val(); var fileTypes = new Array("flv","3gp","mpeg","avi","mp4"); //定义可支持的文件类型数组 var fileTypeFlag = "0"; var newFileName = video_src_file.spli…