<script type="text/javascript">
function GetRequest() {
var url = location.search; //��ȡurl��"?"������ִ�
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("&");
for(var i = 0; i < strs.length; i ++) {
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
return theRequest;
} var request = new Object();
request = GetRequest(); checkWidth(); function checkWidth() { //if (undefined != request["Account"] && undefined != request["paihangbang"] && undefined != request["benlunmingci"] && undefined != request["tunshirenshu"] && undefined != request["benlunzuidatizhong"]) {
// window.location.href = "share.html"+location.search;
// return;
//} var math = Math.floor(Math.random()*10); if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){
if(window.location.href.indexOf("?mobile")<0){
try{
if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
}else if(/iPad/i.test(navigator.userAgent)){
}else{
} if(undefined != request["Account"] && undefined != request["id"])
{
window.location.href = "index_mobile_share.html"+location.search;
return;
}else{ if(math <= 5){
window.location.href="index_mobile.html"+location.search;
return;
}else{
window.location.href="index_mobileA.html"+location.search;
return;
} }
}catch(e){}
}
}else{
if(math <= 5){
window.location.href="index_PC.html"+location.search;
}else{
window.location.href="index_PCA.html"+location.search;
} }
} </script>

  

js判断手机还是pc并跳转相关页面的更多相关文章

  1. js判断手机访问PC端跳转到手机站

    <script type="text/javascript">(function() { //得到域名后缀 var path = location.pathname.s ...

  2. js判断手机或Pc端登陆.并跳转到相应的页面

    <script src="~/Web/js/jquery-1.10.1.min.js"></script> <script> $(functio ...

  3. js判断手机访问web网站跳转到手机版

    第一种:直接JS脚本 <script type="text/javascript">try {var urlhash = window.location.hash;if ...

  4. js判断手机浏览器操作系统和微信浏览器的方法

    做手机端的前端开发,少不了对手机平台的判断.如,对于app下载,就要判断在Android平台下就显示Android下载提示:在iOS平台下就显示iOS下载提示. 今天就为大家介绍一下用js判断手机客户 ...

  5. js判断手机 横屏模式

    js判断手机 横屏模式 方法名称:orientation 实例: if(window.orientation!=0){ var obj=document.getElementById('orienta ...

  6. 如何利用JS判断当前来路域名并跳转到指定页面

    1.如何利用JS判断当前来路域名并跳转到指定页面 获取当前请求路径var href = location.href ;if(href.indexOf("baidu")>-1) ...

  7. JS实现手机访问pc网址自动跳转到wap网站

    之前写pc端直接跳转wap端一直是后端java写的,跟js一样都是根据navigator.userAgent来判断设备是电脑还是手机的,我知道这种前端也可已完成的功能,只是后台比较强势,本人本着以和为 ...

  8. js判断手机是否安装了某一款app,有则打开,没有去下载

    function openApp(){ if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) { var loadDateTime = new ...

  9. js判断手机的横竖屏调整样式

    在移动端,我们经常遇到横竖屏的问题,所以我们改如何判断或针对横竖屏来写代码呢.首先需要在head中加入如下代码: <meta name="viewport" content= ...

随机推荐

  1. Clearing Search Values

      Use the SearchClear() method which is part of the Field class to clear search values on a particul ...

  2. MHA学习笔记

    MHA是一款开源的MySQL高可用程序,为MySQL主从复制架构提供了节点故障转移功能,当 master发生故障时MHA会自动提升拥有最新数据的slave节点成为新的主节点,还提供了master节 点 ...

  3. 神奇的fastcgi_finish_request

    当PHP运行在FastCGI模式时,PHP FPM提供了一个名为fastcgi_finish_request的方法.按照文档上的说法,此方法可以提高请求的处理速度,如果有些处理可以在页面生成完后再进行 ...

  4. 分享:PHP获取MAC地址的实现代码

    原文地址:http://www.jbxue.com/article/12635.html发布:thatboy   来源:Net     [大 中 小] 分享一例php取得机器mac地址的代码,学习下p ...

  5. SQLite中命令行程序(CLP)的使用

    SQLite CLP是使用和管理SQLite数据库最常用的工具.它在所有平台上的操作方式相同.CLP其实是两个程序,它可以运行在Shell模式下以交互的方式执行查询操作,也可以运行在命令行模式下完成各 ...

  6. wpf的datepicker处理

    如果有2个datepicker,控制时间起和止的话,可以把第二个datepicker加一个属性,DisplayDateStart = "{Binding SelectedDate,Eleme ...

  7. 一段高质量的SQL从问问题开始(笔记)

    首先SQL书写的目的是为了解决问题,因此只有明白了要解决的问题,才能写出更加高效的SQL语句,才能优雅的解决问题,获得更多的快乐! 在写一个SQL语句的时候不妨像优化器一样思考,问自己以下的这些问题, ...

  8. GraphLab面向机器学习的并行框架『针对图数据处理模型』

    最近在做文本处理知识的梳理,关注了CMU提出的GraphLab开源分布式计算系统 这是关于GraphLab的PPT:Distributed GraphLab『 http://cheng-qihang- ...

  9. golang实现ping命令

    // Copyright 2009 The Go Authors.  All rights reserved.// Use of this source code is governed by a B ...

  10. 制作越狱版本的ipa文件

    1.新建项目,证书选择开发者自己创建的证书 2.编译项目,在工程左侧树形菜单中,找到Product,找到编译后的项目,邮件,找到.app文件路径. 3.将这个app文件拖入到iTunes,邮件点击图标 ...