I'm working with a SharePoint
site in which the pages display poorly in mobile, so much so that it's essentially nonfunctional. I'll be rebuilding the site to solve those issues, but in the meantime, I'd like to redirect mobile users to a dedicated mobile site that's built outside of SharePoint
. The problem is that my redirects are working fine for iPhones
and not working for Android OS
.
I've tried the following in the master page:
<script type="text/javascript">
if (screen.width <= 699) {
if (document.referrer.indexOf('http://site.html') == -1){
document.location = "http://site.html";
}}
</script>
and
<script type="text/javascript">
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)){
if(document.URL !="http://site.html")
{
window.location ="http://site.html";
}
}
</script>
AND
<script type="text/javascript"> // <![CDATA[
if ( (navigator.userAgent.indexOf('Android') != -1) ) {
document.location = "http://SITE.html";
} // ]]>
</script>
I understand that Android
users need to manually enable JavaScript
, so I assume that's probably the issue. Any recommendations for alternatives?
Thanks.