Q:

Detecting browser file compatibility

I am looking for a way to detect what files a users web browser can display (natively or via plugin), either server side in PHP or client side in JavaScript. Basically, I want to have a box in which a file is displayed (audio in an <embed>, documents in a <frame>, etc), however if the browser is simply incapable of displaying the file, I want to show the user an error and give them a link to download it.
Thanks for any help.

A:

Your best bet is going to be to determine what browsers are supported and which ones aren't and then use browser detection to determine what response to send to the client.
Quirksmode has a great script for this purpose as well as a demo on this page:
http://www.quirksmode.org/js/detect.html

