You need to sign in to do that
Don't have an account?

Browser Detection in VF
I've got a stylesheet I only want to load if user is using IE. What's the best way to detect browser in VF? Do I just need to inject some javascript? Or is there a way to do this natively?
Thanks!
You should be able to access the user agent from the controller as follows:
String userAgent = ApexPages.currentPage().getHeaders().get('USER-AGENT');
Then you could set a property so that the css inclusion is only rendered based on the contents of this.
I try to avoid javascript where possible, though I find most of the time I can't :)