Home > Web Front-end > JS Tutorial > js blocks pc access

js blocks pc access

花姐姐
Release: 2020-05-06 13:39:07
forward
3536 people have browsed it

js blocks pc access

Block PC access

<script type="text/javascript"> 
    //平台、设备和操作系统 
    var system ={ 
        win : false, 
        mac : false, 
        xll : false
    };
    //检测平台
    var p = navigator.platform; 
    system.win = p.indexOf("Win") == 0; 
    system.mac = p.indexOf("Mac") == 0; 
    system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
    if(system.win||system.mac||system.xll){   
        window.location.href="pc端访问的链接";
    }else{ 
    }
</script>
Copy after login

Just replace the link in the code.

Recommended learning: JavaScript

The above is the detailed content of js blocks pc access. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
js
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Where is js written?
From 1970-01-01 08:00:00
0
0
0
js addClass not working
From 1970-01-01 08:00:00
0
0
0
js file code not found
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template