javaScript判断手机型号】的更多相关文章

window.onload = function () { alert("1"); var u = navigator.userAgent; if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {//安卓手机 alert("安卓手机"); // window.location.href = "mobile/index.html"; } else if (u.indexOf…
javascript判断手机旋转横屏竖屏 // 横屏竖屏函数 function orientationChange(){ switch(window.orientation) { case 0: // Portrait case 180: // Upside-down Portrait //Javascript to setup Portrait view window.location.reload(); break; case -90: // Landscape: turned 90 deg…
移动端的浏览器一般都支持window.orientation这个参数,通过这个参数可以判断出手机是处在横屏还是竖屏状态.从而根据实际需求而执行相应的程序.通过添加监听事件onorientationchange,进行执行就可以了. //判断手机横竖屏状态: function hengshuping(){ if(window.orientation==180||window.orientation==0){ alert("竖屏状态!") } if(window.orientation==9…
<script type="text/javascript"> /* * 智能机浏览器版本信息: * */ var browser={ versions:function(){ var u = navigator.userAgent, app = navigator.appVersion; return {//移动终端浏览器版本信息 trident: u.indexOf('Trident') > -1, //IE内核 presto: u.indexOf('Presto…
由于oppo手机自带浏览器的高度底部多了144px导航栏 所以:专门针对oppo手机做适配: var dowphone = document.getElementById("dowphone"); function validBrowser(){ var u_agent = navigator.userAgent; if(u_agent.indexOf('OPPO R7s Build')>-1){ dowphone.style.width = "54%"; d…
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO) #define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? (…
在页面代码中加入以下js,即可利用JavaScript判断是否是手机mobile登录! <script type="text/javascript" src="${contextPath }/js/uaredirect.js"></script> <script type="text/javascript" type="text/javascript">uaredirect("ht…
做H5页面的时候,经常会用到判断手机是什么系统,根据系统的型号,实现不同的效果,那么如何判断显示页面的手机型号呢? (function(){ var isMobile={ Android:function(){ return navigator.userAgent.match(/Android/i)?true:false; }, Ios:function(){ return navigator.userAgent.match(/iPhone|iPad|iPod/i)?true:false; },…
JavaScript判断用户输入的邮箱格式是否正确.判断用户输入的手机号格式是否正确,下面有个不错的示例,感兴趣的朋友可以参考下. 复制代码代码如下: /*  * 功能:判断用户输入的邮箱格式是否正确  * 传参:无  * 返回值:true or false  */  function form_check() {  var email = document.getElementById("email").value; //获取邮箱地址  //判断邮箱格式是否正确  if(!/^\w+…
/// <summary> /// 判断手机用户UserAgent /// </summary> /// <returns></returns> private bool IsMobile() {          HttpContext context = HttpContext.Current;     if (context != null)     {         HttpRequest request = context.Request;   …