开发者

Detecting Device for website

I'm creating a website wi开发者_JS百科th Flash embedded into it. I understand that iPads do not support flash. I also have a non-flash version ready only to be used for iPad users. How do I detect the end user's device and redirect them to the version directly ?


Assuming you're checking this from the website, you could use the following JavaScript code;

function isiPad() {
    return (navigator.platform.indexOf("iPad") != -1);
}

So, for example, you could add something like this to onload
if(isiPad()) window.location = "http://mysite.com/ipad";

Detect iPad users using jQuery?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜