I'm trying to display different possible links on a page depending on the user. For example, mobile users aren't allowed to submit data to our database. I found a Javascript function that detects mobile users, but I can't get its output to dictate the links that are shown to the user. In fact, when I try using the following code, no links show up at all.
</head>
<body>
</div>
<div id="topcontent">
<p align="center">
<div id="banner">
<p align="center">
<script>
function checkMobile(){
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
<a href="studyAreas.html">
Wifi Study Areas</a>
<a href="displayspeeds.html">
View all Speeds</a>
<a href="bestlocation.html">
Best Speed Near You</a>
<a href="squadfree/index.html">
About Us</a>
}
else{
<a href="studyAreas.html">
Wifi Study Areas</a>
<a href="displayspeeds.html">
View all Speeds</a>
<a href="bestlocation.html">
Best Speed Near You</a>
<a href="userEnterInfo.html">
Add Speed Data</a>
<a href="squadfree/index.html">
About Us</a>
}
}
</script>
</p>
</div>
<div id="centercontent">
<h3 align="center">
Find the best study space</h3>
<h1 align="center">
Check Your Internet Speed With WiFly</h1>
<p align="center">
<img src="http://cdn.flaticon.com/png/256/15402.png" alt="wifi" />
</p>
<p align="center">
</p>
</div>
</body>