Online Shopping : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

6 of 34 people (18%) answered Yes
Recently 0 of 10 people (0%) answered Yes

Entry

how can i detect wether the user has an acrobat reader plugin?

Apr 5th, 2008 20:31
ha mo, Lhotsie Pereira, Colin Fraser, Arismonty Beato,


This is supposed to be very easy, but it is not. This is because
different browsers use different ways to store their plugins.
Historically, Netscape allows you to detect plugins simply and the
information for that can be found in the documentation links found on
the FAQTS Javascript page. IE however is a very different kettle of fish
and I have never been able to get the equivalent code to work in IE. 
Try : 
test=navigator.mimeTypes["video/quicktime"]
if (test)
    document.writeln("<embed src='quick.mov' height=100 width=100">
else
    document.writeln("<img src='quick.gif' height=100 width=100>")
All you need do is substitute the Acrobat Reader plugin type for the
video plugin type. (Personally, I dont have Acrobat as a plugin, as it
annoys me that I have to wait for the browser to start the plugin, then
wait an indeterminate time for the file to be downloaded. I can be
impatient with the Net, so I just download *.pdf files and view them
later at my leisure. Bear in mind also that many people are like me in
this regard, so if you are thinking of directing a user to download the
plugin instead of the file you want them to see, be very careful.I know
I would not appreciate it if everytime I went to download the file you
are offering I ended up at some site looking at downloading Acrobat
Reader, but then I am a surly curr...grrr..)
You may also want to check out the Dynamic Duo link also located on the
FAQTS Javascript front page. That has a lot of information about
cross-browser scripting. Good luck
This should help you:
http://www.javascriptkit.com/script/script2/plugindetect.shtml
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com