how do i change the content of a div when accessed from ios device and android device. i am creating a mobile website for a app for the company i work in, it is based on jquery mobile framework. the problem is if the user is on ios device then he should get the app store link and if he is on android device then he should get the android market link.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Thank You</title>
<link rel="stylesheet" href="../../jquery.mobile-1.0.1.min.css" />
<link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
<script src="../../jquery.js"></script>
<script src="../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
<script src="../_assets/js/jqm-docs.js"></script>
<script src="../../jquery.mobile-1.0.1.min.js"></script>
<script type="text/javascript">
<!--
if (screen.width >= 330) {
document.location = "indexandroid.html";
}
//-->
</script>
</head>
<body>
<div data-role="page" class="type-home">
<div data-role="header" data-theme="f">
<h1>ThankYou!</h1>
<a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-left jqm-home">Home</a>
</div><!-- /header -->
<div class="content-secondary">
<div>
<p class="intro2"><strong>Download the App.</strong></p>
<div class="store">
<a href="##"><img src="../_assets/images/app-store.png"></a>
<a href="##"><img src="../_assets/images/android-market.png"></a>
</div>
</div>
</div>
</body>
</html>
right now i have this javascript code that sends the user to the specific page if there screen size is bigger than the specific one.
As far as I know, the easiest way to do this would be with user-agent detection…
etc…