Mobile Browser Detection

By candice

Following on from my last round of feedback I figured I needed to focus on sorting out the iPhone display issue given this is a key player in the mobile market!

I figured I needed to get the page to reload into the empty <div> tag but I only wanted to do this if I had a mobile viewing the website. I set about locating a mobile browser detection script. Previously I’ve found this to be a closely guarded secret so I was unsure what I would find. I stumbled upon this website: detectmobilebrowsers.com. It provides code for all manner of coding languages – my key languages of interest were jquery, javascript and c#.

I figured for this implementation I would just crack on with the javascript/jquery and get the detection running so I could reload the Google Map. The code it spat out wasn’t a ready made solution – I still had to figure out what it was doing to a certain extent and then make custom functions out of the code that was presented. This didn’t take too long and did physically seem to work.

So, very pleased with myself I decided to call up one of my colleagues to test out my newly deployed update on their iPhone 4S. To my amazement it didn’t work! Google Maps are iPhone compatible – what am I doing wrong?! It can’t be the loading as even that didn’t make a difference!

Another colleague also on an iPhone 4S came to my aid and the website worked on their phone. Wah?! This is crazy! Good but crazy! All settings and iOS versions appeared to be the same so nothing made sense. Apparently this phone is due to go back for other issues so I could only assume that this was the problem – but could I?

I decided to broadcast to the company in a ‘Your Country Needs YOU!’ stylee and had a load of responses confirming the site worked on various iPhones. Cheers guys. The men in white coats have been stood down. I am Not going mad. Phew!

Related posts