Jump to content

MediaWiki:Common.js: Difference between revisions

From Utpalasia Wiki
rewrite
change to redirect method
Line 3: Line 3:
if(navigator.userAgent.toLowerCase().indexOf("android") != -1)
if(navigator.userAgent.toLowerCase().indexOf("android") != -1)
{
{
   document.location(document.URL + "?useformat=mobile");
   window.location.replace(document.URL + "?useformat=mobile");
}
}
else if(document.documentElement.clientWidth <= 787 && document.URL.search("mobile") == -1)
else if(document.documentElement.clientWidth <= 787 && document.URL.search("mobile") == -1)

Revision as of 14:39, 6 April 2013

/* Any JavaScript here will be loaded for all users on every page load. */

if(navigator.userAgent.toLowerCase().indexOf("android") != -1)
{
  window.location.replace(document.URL + "?useformat=mobile");
}
else if(document.documentElement.clientWidth <= 787 && document.URL.search("mobile") == -1)
{
  window.location.replace(document.URL + "?useformat=mobile");
}