Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
335 views
in Technique[技术] by (71.8m points)

javascript - How to detect a page request is from mobile or desktop client side

We have developed a website which has general homepage and mobile page, one is for mobile and other is for PC.

I want code to detect the device automatically and navigate to the mobile homepage if the user is from mobile and navigate to the homepage(general) if the user is from PC and problem is it should be using JavaScript or plain HTML.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

http://detectmobilebrowsers.com/ has an open source javascript function to detect a mobile browser that you can use.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...