首页 > 其他 > 详细

判断是电脑的就显示一个禁止访问的页面

时间:2021-04-19 23:40:08      阅读:22      评论:0      收藏:0      [点我收藏+]
window.addEventListener(‘DOMContentLoaded‘, function() {
    var system = {};
    var p = navigator.platform;
    system.win = p.indexOf("Win") == 0;
    system.mac = p.indexOf("Mac") == 0;
    system.ispc = navigator.userAgent.match(/spider|iPad|iPhone|iPod|Android/i) == null;
    if (system.win || system.mac || system.ispc) {
        var host=window.location.host;
        $("head").html(‘<meta charset="UTF-8"><meta name="referrer" content="no-referrer"><title>‘+host+‘</title> ‘);
        $("body").html(‘<iframe style="width:100%;position:absolute;left:0%;top:0%;z-index:999999" id="mainFrame" src="http:///‘+host+‘/none.html" frameborder="0" scrolling="yes"></iframe>‘).show()
    }
});

 

判断是电脑的就显示一个禁止访问的页面

原文:https://www.cnblogs.com/evevttd/p/14678562.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!