codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Testing if object exists in IE  redbrad0 at 16:10 on Sunday, November 29, 2009
 

I have a script that I had written for me that works in IE (I guess its a ActiveX?) but I display it in the HTML page as the below HTML. I want to be able to tell in Javascript if this object is available in IE

<object id="IEPrinterChecker" classid="CLSID:506974F1-EA53-40C6-940A-4A1D47D5934B" width="0" height="0"></object>

Listed below you can tell I can check if the plugin is available in Firefox without having to specify in the html the object. How can I do this in IE?

<script language="JavaScript">
var plugin;
if ( window.ActiveXObject ) {
// IE
alert("How do I check for the plugin here?");
} else {
var type = "application/printer-checker-component;version=1.0.0.1"; // your mimeType
if (navigator && navigator.mimeTypes){
var mt = navigator.mimeTypes;
for (var i = 0; i < mt.length; i++){
if (mt.type == type) {
plugin = mt.enabledPlugin;
if (plugin) break;
}
}
}
}
if(plugin) {
// insert object and/or test the plugin with script
alert("plugin is available");
} else {
alert("plugin not available or disabled");
}
</script>








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  matrix prblm in java
•  Re: how to open instantly a pop up window whenever a user sends a message to the other user
•  Re: PING PROGRAM IN PERL
•  Re: date of birth validation using java script-very urgent
•  JAVA If statements
•  Need Help with a Regular Expression
•  Informations on HTML
•  Re: FREE TV on your PC!
•  Re: Using Lucene or Solr ?


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010