Serve a script to desktops only, not smartphones?
I have YouTube videos in my site opening in a modal window (ColorBox开发者_如何学Go). When I try it on my iPhone, the window launches but the video doesn't play.
How can I prevent the modal window script from being served to smartphones, so that videos launch normally on those devices?
Thanks!
You could sniff the user agent with some javascript or even server side code, but make sure to give your users a way to switch manually between the two.
Nothing sucks more than getting the phone version on a computer because you're using an unknown browser like konqueror or getting the computer version on a phone because you're using a windows 7 phone.
精彩评论