js判断页面是从pc,ipad,phone 打开的

    function IsPC() {
        var userAgentInfo = navigator.userAgent;
        var Agents = [
            "Android",
            "iPhone",
            "SymbianOS",
            "Windows Phone",
            "iPad",
            "iPod"
        ];

        for (var v = 0; v < Agents.length; v++) {

            if (userAgentInfo.indexOf(Agents[v]) > 0) {

                return Agents[v];
            }

        }
    };
    var shebei = IsPC();
    console.log(shebei)

 

相关文章:

  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2021-11-26
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-01
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
相关资源
相似解决方案