If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Developer
jyee
Posts: 3
Registered: ‎03-06-2009
My Device: Not Specified

css detect?

[ Edited ]

Is there a way to detect if a user has enabled CSS support on their browser?

Message Edited by jyee on 03-06-2009 12:16 AM
Please use plain text.
Guru I
Xandrex
Posts: 18,380
Registered: ‎07-29-2008
My Device: Z10 10.1.0.2312 / Playbook 2.1 / 8900 5.0
My Carrier: Vodafone France (SFR) & B&You

Re: css detect?

there is not.
but you can add "special CSS code" so that you can use some CSS for a browser and some CSS for the other. It is useful when the CSS support of a given browser is deficient (it is the case of MSIE6 for instance).



The search box on top-right of this page is your true friend, and the public Knowledge Base too:
Please use plain text.
New Developer
New Developer
mma
Posts: 3
Registered: ‎11-03-2010
My Device: Blackberry smartphone 8330
My Carrier: Beill

Re: css detect?

how to detect blackberry to use another css file in HTML (javascript).

Please use plain text.
Administrator
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: css detect?

If your application is able to get the "Accept" HTTP header and inspect its contents, you should be able to determine whether CSS is supported by the presence of the "text/css" MIME type.

 

This is useful for very old versions of the BlackBerry Device Software, where a user had the option to enable/disable CSS support from within the browser application.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
Guru I
Xandrex
Posts: 18,380
Registered: ‎07-29-2008
My Device: Z10 10.1.0.2312 / Playbook 2.1 / 8900 5.0
My Carrier: Vodafone France (SFR) & B&You

Re: css detect?

 


mma wrote:

how to detect blackberry to use another css file in HTML (javascript).


 

remember most users have javascript not enabled by default on their devices, so I believe server-side detection is better (php, asp or any other server-side language).

 

That being said, if you want a javascript solution, you can rely on the user-agent (provided the user has not configured its device to appear like Firefox) :

 

document.write (navigator.userAgent.toLowerCase());

and then work on that string.

 




The search box on top-right of this page is your true friend, and the public Knowledge Base too:
Please use plain text.