4 ms·
In theory, browser detection is bad, because we should rely on detecting whether JavaScript functions exist or not, etc. In practice, browser detection is usua
by crazygringo 13y ago
In theory, browser detection is bad, because we should rely on detecting whether JavaScript functions exist or not, etc.
In practice, browser detection is usually necessary, no way around it. Thinking about writing HTML5 audio functionality? Guess what, every browser implements it differently, and you just have to detect the browser so you know whether to respond to the 'ended' event or the 'pause' event, or whether calling load() before playing is necessary, or will crash a certain mobile browser. (I could go on about 100 more things.)
So, in an interview, always explain that browser detection is bad. Once you're hired, you'll find that most reasonably complex sites use it out of necessity.