Javascript参考手册
----------------------------------------------------------------------------------------------------------------------------------
获取ev目标元素 ev.srcElement || ev.target;
判断ev目标元素类型 var obj = ev.srcElement || ev.target; obj.nodeName
----------------------------------------------------------------------------------------------------------------------------------
判断浏览器类型是否为Firefox
isFirefox=navigator.userAgent.toUpperCase().indexOf("FIREFOX")>0?true:false; //If it is Firefox
----------------------------------------------------------------------------------------------------------------------------------
判断客户端设备
// 获取终端的相关信息 var Terminal = { // 辨别移动终端类型 platform : function(){ var u = navigator.userAgent, app = navigator.appVersion; return { // android终端或者uc浏览器 android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, // 是否为iPhone或者QQHD浏览器 iPhone: u.indexOf('iPhone') > -1 , // 是否iPad iPad: u.indexOf('iPad') > -1 , // 是否为windows windows: u.indexOf('Windows NT') > -1 , // 是否为mac mac: u.indexOf('Mac') }; }(), // 辨别移动终端的语言:zh-cn、en-us、ko-kr、ja-jp... language : (navigator.browserLanguage || navigator.language).toLowerCase() } // 根据不同的终端,跳转到不同的地址 var theUrl = '默认地址'; if(Terminal.platform.android || Terminal.platform.windows){ theUrl = 'android和windows下载地址'; //theUrl = '${request.getContextPath()}/download/android'; }else if(Terminal.platform.iPhone || Terminal.platform.mac){ theUrl = 'iphone和mac下载地址'; }else{ alert("不支持的操作系统,默认下载Android平台"); } //location.href = theUrl; document.write(theUrl);