0

Hello,

I have build a website and would like to build the web application for it as it has some flash content which is not supported by Apple. When the user access it from a device(mobile phone or ipad) I would like the user to be directed to that web Application instead.

My question is what can I use to build the application?

Sorry if my question is a bit stupid to you, I am new to web applications.

3
Contributors
2
Replies
7
Views
4 Years
Discussion Span
Last Post by Bob Hensley
1

Apple devices have unique user agents, all with their device name within it. For example, an iPhone 5 may have a user agent of Apple-iPhone5C2 (which, by the way, will be most USA-based iPhone 5 users). This can be taken advantage in detecting whether a visitor is using an Apple device. The following script will do just that:

<script>
//<![CDATA[

iosReg = '/apple-[ipod|iphone|ipad]/i';

if (navigator.userAgent.search (iosReg))
{
  // What do you want to do with the Apple device?
}

//]]>
</script>

Fortunately (or unfortunately, in this case) I am an Android user so I cannot test the validity of my RegEx pattern. But it should be fine.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.