Display PDF using plugin : PlugIn : Development JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Development » PlugIn »

 

Display PDF using plugin



<html>
<head>
<script language="JavaScript">
<!--
function findPlugin(ext) {
  var thisExt, findExt;
  for (var n=0; n < navigator.plugins.length; n++) {
      for (var m=0; m < navigator.plugins[n].length; m++) {
          thisExt = navigator.plugins[n][m].description.toLowerCase();
          findExt = thisExt.substring(0, thisExt.indexOf(" "));
          if (findExt == ext)
             return(true);
      }
  }
  return(false);
}
  
if (findPlugin("pdf")) {
   document.open();
   document.write("<embed src='yourFile.pdf' width='100%'>");
   document.close();
}
else {
   location = "http//www.navioo.com";
}
//-->
</script>
</head>
</html>



           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Development
» PlugIn