• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

'Droid Mobile Web Browsing issue...?!

Hi guys,

I work for a company that is developing mobile websites for our clients but I'm having an issue with Android phones displaying the correct website.

We have a simple script in the head tag (which works correctly for Blackberrys/iPhones) but isn't working for Androids. The script is suppose to redirect users to enterwebsitedomainhere.com/mobile when enterwebsitedomainhere.com is entered in a mobile device.

The script is as follows:
<script type="text/javascript"> <!-- if (screen.width <= 450) { document.location = "/mobile/index.html"; } //--> </script> ​
Last week it would redirect correctly, then I'd test 5-10min.'s later & it wouldn't redirect. It was like my phone was playing games & decided to do "whatever it felt like doing" lol. I have been testing it today & it hasn't once redirected....I'm very confused by this. Also, if you are wondering what kind of phone I am testing on - its a HTC Merge. Its browsing settings are as follows:

  • mobile view "enabled"
  • javascript "enabled"
  • cache reset & is STILL displaying desktop version URL, not actual mobile version
 
Back
Top Bottom