Mobile Browsers

T

Tom Bowen

Hello, how can I use Format/Behaviors/Insert/Check Browser to detect that
someone is using a mobile browser and then redirect them to another URL where
the content is formatted for a Smartphone/PDA/Mobile phone browser?

For example, when I go to www.google.com using my mobile smart phone, I'm
automatically redirected to www.google.com/m so the mobile version of the
site loads.

Thank you!!
 
I

Ian Haynes

Hello, how can I use Format/Behaviors/Insert/Check Browser to detect that
someone is using a mobile browser and then redirect them to another URL
where
the content is formatted for a Smartphone/PDA/Mobile phone browser?

Adding a new case to the select may work:

case "Mobile":{
tm=(agt.indexOf("mp")!=-1};
break;}

(It may need to be agt.IndexOf("MP") . I'm not able to test it.)

Then for your body onLoad

<body onload="FP_checkBrowser('Mobile', 'any', /*href*/'index1.htm',
/*href*/'index2.htm')">

This may not be very reliable however because as I understand it, most
mobile browsers have JavaScript disabled by default.

If you're using asp, ASP.Net, or PHP you can detect the browser with simple
script, which would get over the JavaScript issue.

Note: Just tested this on my PDA and it does redirect correctly for the
mobile device and for FF, Opera and Safari(Win) but not for IE7. Looks like
the basic behaviours script need modification.
 
I

Ian Haynes

Adding a new case to the select may work:
case "Mobile":{
tm=(agt.indexOf("mp")!=-1};
break;}

(It may need to be agt.IndexOf("MP") . I'm not able to test it.)

Hold on this .....

Although it does detect my mobile browser it falls over with IE7. Without
the added code IE7 is detected correctly.

Can't see why at the moment.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top