前端开发非微信打开网页时的提示页面

前端模块化开发优缺点
c#前端模块化开发
前端模块化开发好处

html 代码

<!DOCTYPE html>
    <head>
        <meta
            name=”viewport”
            content=”width=device-width, initial-scale=1, user-scalable=0″
        />
    </head>
    <body>
        <script type=”text/javascript”>
            var ua = navigator.userAgent.toLowerCase()
            var isWeixin = ua.indexOf(‘micromessenger’) != -1
            var isAndroid = ua.indexOf(‘android’) != -1
            var isIos = ua.indexOf(‘iphone’) != -1 || ua.indexOf(‘ipad’) != -1
            if (!isWeixin) {
                document.head.innerHTML =
                    ‘<title>抱歉,出错了</title><meta charset=”utf-8″><meta name=”viewport” content=”width=device-width, initial-scale=1, user-scalable=0″><link rel=”stylesheet” type=”text/css” href=”https://res.wx.qq.com/open/libs/weui/0.4.1/weui.css”>’
                document.body.innerHTML =
                    ‘<div class=”weui_msg”><div class=”weui_icon_area”><i class=”weui_icon_info weui_icon_msg”></i></div><div class=”weui_text_area”><h4 class=”weui_msg_title”>请在微信客户端打开链接</h4></div></div>’
            }
        </script>
    </body>
</html>
前端模块化开发注意
模块化前端开发方案
前端开发对模块化的认识
» 本文来自:前端开发者 » 《前端开发非微信打开网页时的提示页面》
» 本文链接地址:https://www.rokub.com/6989.html
» 您也可以订阅本站:https://www.rokub.com
赞(0)
64K

评论 抢沙发

评论前必须登录!