Home  >  Article  >  Web Front-end  >  How to determine whether to log in to a mobile phone or a computer in an html webpage

How to determine whether to log in to a mobile phone or a computer in an html webpage

高洛峰
高洛峰Original
2017-03-24 11:31:502917browse

This article explains in detail how to determine whether to log in to a mobile phone or a computer using an HTML web page

<script type="text/javascript">
try{
    if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
        window.location.href="mindex.html";
    }else{
        window.location.href="cindex.html";
    }
}catch(e){}
</script>

The above is the detailed content of How to determine whether to log in to a mobile phone or a computer in an html webpage. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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