I'm building one single page website and I want my page to load at some specific div depending if using normal computers or mobiles devices, all I have is:
<script type="text/javascript">
onload = function()
{location.href = "#home";}
</script>
The code seems to work fine but then I need to detect mobile device so page can scroll down to another div on load function, I have this code so far but I can't make it work:
<script type="text/javascript">
onload = function()
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/i))
{location.href = "#packages";}
</script>
How can I fix this and how can I put both codes together?