browser detection, client or server?
I am developing a website using CSS3 animations, video, canvas etc and the same website for mobile devices.
So, depending on the browser the content varies. For example:
If the user has a mobile browser the content is different.
If the user is using IE, I can not show animations.
For what I have read, it seems to me that it is better to do in PHP, including files depending of the browser.
Thank you very much!!!
Hi criterion9! Thank you for response!
First of all, the application performs CSS3 animations, text shadows etc.... so for older browsers another css file should be showed instead. I could do this with PHP server detection, but I have read about modernizr to perform browser detection on the client-side.
Right now I am reading about WURLF to perform server browser detection.
What do you think is the best way??
Thank you very much!
I would use graceful fallbacks so that user will get an approximation of the functionality if they can't view the full deal. If a browser cannot support a CSS declaration it won't try so it doesn't hurt to have those in the file sent to a browser that can't handle the animation.
That's what conditional tags and media queries are for.. e.g;
<!--[if IE 8]><html class="lt-ie9" lang="en"><![endif]-->
Relying on too many libraries though isn't cool.. I don't like looking at my cpu monitor and seeing 30% (from 5%) usage on a overclocked i7 on a website. ipad's won't like it either - especially the newer ones, theyre notoriously slow for "bleeding edge" html5/js/css.. I've been to websites on my old e7300 computer that would nearly max the cpu.. that's pathetic
if( document.documentElement.className == 'lt-ie9' )
only use jquery for things that actually save u time.. $('html').hasClass('lt-ie9'); might save u 1 second in typing but adds a lot more cpu cycle - when you start running more complicated apps and checks with numerous loops and what not it starts adding up fast. I recently made a puzzle with jquery and by that change (looping through 25 input boxes to check values) it would actually lag on slower computers
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)