views:

51

answers:

2

I have some JavaScript that doesn't work correctly on the Blackberry 8300. The page renders differently if JavaScript is disabled. However, I'd like to be able to have the page render the "JavaScript disabled" version also if the user is on a Blackberry 8300 or on a media of type "handheld".

Is there some way I can do this? Or some check I can do? Can I detect whether the media is "handheld" and if so, to render the non-JavaScript version of the page?

For example, some if case where if media==handheld, then .. SOME HTML HERE ..

Or is there some way to "degrade" a browser to an older version?

+1  A: 

In pure HTML you have the noscript tag. Any other form of conditional output will have to be done on the server in another language of your choice.

Azeem.Butt
+1  A: 

You can check User Agent in the HTML header.

Blackberry's browser identifies itself as something like: BlackBerry8700/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1. Just check whether "BlackBerry" is a substring.

There is a incomplete List of user agents for mobile phones.

Iamamac