User agents for mobile site, domain changing

前端 未结 3 418
猫巷女王i
猫巷女王i 2021-01-24 14:56

I have a mobile site and I\'d like to redirect users to the domain.mobi or mobile.subdomain (we have both setup)

  1. How do I determine a mobile browser
  2. Is it b
3条回答
  •  醉梦人生
    2021-01-24 15:43

    1. How do I determine a mobile browser

    Here's some javascript that will do the job: http://www.quirksmode.org/js/detect.html

    1. Is it bad practice to have the mobile site on a different domain or subdomain?

    It's good practice, and a popular convention is to use http://m.yoursite.com for mobile if your main url is http://yoursite.com

    Noah

提交回复
热议问题