<html>
<head>
<title>Mobile Detection</title>
<script>
function DetectIphone()
{
var uagent = navigator.userAgent.toLowerCase();
if (uagent.search("iphone") > -1 || uagent.search("ipod") > -1 || uagent.search("android") > -1)
alert('true');
else
alert('false');
}
</script>
</head>
<body>
<input type="button" OnClick="DetectIphone()" value="Am I an Iphone?" />
</body>
</html>
<head>
<title>Mobile Detection</title>
<script>
function DetectIphone()
{
var uagent = navigator.userAgent.toLowerCase();
if (uagent.search("iphone") > -1 || uagent.search("ipod") > -1 || uagent.search("android") > -1)
alert('true');
else
alert('false');
}
</script>
</head>
<body>
<input type="button" OnClick="DetectIphone()" value="Am I an Iphone?" />
</body>
</html>
No comments:
Post a Comment