Friday, November 15, 2013

Detect iPhone through JavaScript

Here is a quick script to redirect iOS (iphone and iPad) users to the mobile page.
<html>
<head>
<script type="text/javascript">
   if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPad/i))) {
        window.location = "Default_m.aspx";
        }
</script>
</head>
<body>
     This is a non mobile page.
</body>
</html>
This script should be inside the head tag for performance. Script will redirect user to mobile page before the body of the page gets rendered.

Publiahing Sites vs Communication Sites

It was announced in SharePoint Virtual Summit in May 2017, a more modern way of content publishing is released called Communication Sites. ...