Foros del Web » Programando para Internet » Javascript »

Detectar JAVA

Estas en el tema de Detectar JAVA en el foro de Javascript en Foros del Web. ¿Algún script para detectar si el cliente tiene instalado JAVA? Gracias ;)...
  #1 (permalink)  
Antiguo 29/10/2004, 02:44
 
Fecha de Ingreso: octubre-2004
Mensajes: 21
Antigüedad: 19 años, 6 meses
Puntos: 1
Detectar JAVA

¿Algún script para detectar si el cliente tiene instalado JAVA?

Gracias ;)
  #2 (permalink)  
Antiguo 29/10/2004, 05:10
 
Fecha de Ingreso: octubre-2004
Mensajes: 21
Antigüedad: 19 años, 6 meses
Puntos: 1
Me contesto a mí mismo (Después de 2 horas en google )

detecta.html
Código HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<script src="plugins.js">
</script>
</head>
<body>
</body>
</html> 
plugins.js
Código HTML:
//This script detects the following:
//Flash
//Windows Media Player
//Java
//Shockwave
//RealPlayer
//QuickTime
//Acrobat Reader
//SVG Viewer


var agt=navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var ns  = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);

if (ie && win) {	pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","Acrobat Reader"); }
if (ns || !win) {
		nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
		pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
}

function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n'); if (result) return name+','; else return ''; }
function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; }

pluginlist += navigator.javaEnabled() ? "Java," : "";
if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);

//SAMPLE USAGE- detect "Flash"
if (pluginlist.indexOf("Java")!=-1)
document.write("You have java installed")

A cajcal·la
  #3 (permalink)  
Antiguo 01/03/2010, 19:16
 
Fecha de Ingreso: mayo-2003
Ubicación: Tauranga, NZ.
Mensajes: 89
Antigüedad: 20 años, 11 meses
Puntos: 0
Respuesta: Detectar JAVA

alguien pudo probarlo? O saben de alguna pagina que lo tenga?
En esta maquina no puedo hacerlo...
Gracias
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:36.