Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> JavaScript >> Snippet

Information Report


< html >
< head >
</ head >

< body Background = .. / graphics / grayback.jpg >
< center >< BR >
< font face = "arial, helvetica" size = "-1" > (Be sure to pick a mimeType or plugin from the pulldown menu ! ) </ font >
< p >
< form >
< table border = 1 cellpadding = 0 cellspacing = 0 >
< tr >< td bgcolor = "#bfbfbf" align = "right" >
< script >
<!-- Original :  Dion (yobo42@hotmail.com) -->
<!-- Web Site :  http : //www.iinet.net.au/~biab/ -->
var ary = new Array ( "appCodeName" , "appName" , "appVersion" , "mimeTypes" , "plugins" , "userAgent" , "javaEnabled()+''" , "X" , "width+''" , "height+''" , "colorDepth+''" , "X" , "history.length+''" );
var box = new Array ( "<input type='text' size=30 value='" , "'>" , "<select onchange='more(this,this.form);'>" , "" , "<input type='text' size=6 value='" , "'>" );
cnt = 0; fmtcnt = 0; var bgn = new Array ( "navigator" , "screen" , "window" );
for (i = 0;i < ary.length - 2;i ++ ) {
b = 0; if (ary[i + cnt] == "X" ) cnt ++ ;
val = eval (bgn[cnt] + "." + ary[i + cnt]); fmt = "<br>\n" ;
l = val.length; if (l > 0) {
if (val.toString().indexOf( 'Array' ,0) >- 1) {
val = "" ; b = 2; box[3] = "</select>" + box[4] + eval (bgn[cnt] + "." + ary[i + cnt] + ".length" ) + box[5];
for (j = 0;j < l;j ++ )
val += "<option value=" + i + ">" + eval (bgn[cnt] + "." + ary[i + cnt] + "[" + j + "].description" ).substring(0,30); } ;
if (ary[i + cnt].indexOf( "+''" ,0) > 0) {
b = 4; fmtcnt = (fmtcnt + 1) % 3; if (fmtcnt > 0) fmt = "\n" ;
ary[i + cnt] = ary[i + cnt].substring(0, escape (ary[i + cnt]).indexOf( '%' ) - 1); } ;
document.write(ary[i + cnt] + ":" + box[b] + val + box[b + 1] + fmt);
   }
}

function more(sel,frm) {
frm.ta.value = "" ; cnt = 1; nm = navigator.mimeTypes; ssi = sel.selectedIndex;
if (display(sel,frm,nm,ssi) == 1)
for (k = 0;k < nm.length;k ++ )
if (isEnabled(k))
if (isEnabled(k).name == navigator.plugins[ssi].name) {
frm.ta.value += cnt + ")." ; cnt ++
display(frm.elements[3],frm,nm,k);
   }
}

function display(sel,frm,nm,ssi) {
which = sel.options[ssi].value - 3;
var prms = new Array ();
prms[0] = new Array ( "mimeTypes" , "description" , "suffixes" , "type" , "enabledPlugin.name" );
prms[1] = new Array ( "plugins" , "description" , "filename" , "length" , "name" );
ln = 5; if (which == 0) if ( ! isEnabled(ssi)) ln = 4;
for (i = 1;i < ln;i ++ )
frm.ta.value += prms[which][i] + ":" + eval ( "navigator." + prms[which][0] + "[" + ssi + "]." + prms[which][i]) + "\n" ;
return which;
}

function isEnabled(n) {
return navigator.mimeTypes[n].enabledPlugin;
}
</ script >

< br >
< textarea cols = 40 rows = 6 name = "ta" value = "" ></ textarea >
</ td ></ tr >
</ table >
</ form >


</ center >
</ BODY >
</ html >

//Thanks to David Pye for his JavaScript Vault contribution.