欢迎光临
我们一直在努力

检测客户端显示相应页面asp+js代码。

建站超值云服务器,限时71元/月

<%
    bigurl = "bigscreen.htm"
    smallurl = "smallscreen.htm"
    a = lcase(request.servervariables("http_user_agent"))
    if instr(a,"msie 5")>0 or instr(a,"msie 4")>0 then
%>

        <script language="javascript">
        var w = document.body.clientwidth;
        if (w>=650)
        {
            window.location.href="<%=bigurl%>";
        }
        else
        {
            window.location.href="<%=smallurl%>";
        }
        </script>

<%
    elseif instr(a,"msie 3")>0 then

        smallurl = "smallscreen.htm"
        bigurl = "bigscreen.htm"
        a = request("http_ua_pixels")
        url = smallurl
        if instr(a,"x")>0 then
            a = split(a,"x")
            if clng(a(0)) >= 650 then
                url = bigurl
            end if
        end if
        response.redirect(url)

    elseif instr(a,"zilla/4")>0 then
%>

        <script language="javascript">
        var w = document.body.clientwidth;
        if (w>=650)
        {
            window.location.href="<%=bigurl%>";
        }
        else
        {
            window.location.href="<%=smallurl%>";
        }
        </script>

<%
    elseif instr(a,"zilla/3")>0 then
%>

        <script language="javascript">
        var sizer=java.awt.toolkit.getdefaulttoolkit();
        var scrsize=sizer.getscreensize();
        var scrw=scrsize.width;
        if (scrw>=650)
        {
            window.location.href="<%=bigurl%>";
        }
        else
        {
            window.location.href="<%=smallurl%>";
        }
        </script>

<%
    else
        respose.redirect(smallurl)
    end if
%>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 检测客户端显示相应页面asp+js代码。
分享到: 更多 (0)