HTML gevorderde |
|
werkt voor alle brouwsers
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
<!--
document.write('navigator.appName: ' + navigator.appName)
// -->
</SCRIPT>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript"> <!-- document.write('navigator.appName: ' + navigator.appName) // --> </SCRIPT>
dit is die van watismijnip
<script language="JavaScript">
var number_of_values_to_test = 4;
var name_array = new Array(number_of_values_to_test);
var properties = new Array(number_of_values_to_test);
name_array[0] = "Application Name";
properties[0] = "appName";
name_array[1] = "Code Name";
properties[1] = "appCodeName";
name_array[2] = "Version";
properties[2] = "appVersion";
name_array[3] = "User Agent";
properties[3] = "userAgent";
// Loop through the properties, outputting one table row for each one.
document.writeln("<table border='0' width='100%' cellpadding='0' cellspacing='0' align='center'>");
for (var index=0;index < number_of_values_to_test;index++) {
document.writeln("<td width='200' bgcolor='#eeeeee'><img src='single_bullet.gif' width='10' height='14' alt='*' border='0' align='absmiddle'><font color='#034e7f'>");
document.write(name_array[index]);
document.writeln("</font></td>");
document.writeln("<td width='1' bgcolor='#CCCCCC'></td>");
document.writeln("<td bgcolor='#eeeeee'><font color='#034e7f'>");
document.write(navigator[properties[index]]);
document.writeln("</font></td></tr>");
}
document.writeln("</table>");
</script>
<script language="JavaScript"> var number_of_values_to_test = 4; var name_array = new Array(number_of_values_to_test ); var properties = new Array(number_of_values_to_test ); name_array[0] = "Application Name"; properties[0] = "appName"; name_array[1] = "Code Name"; properties[1] = "appCodeName"; name_array[2] = "Version"; properties[2] = "appVersion"; name_array[3] = "User Agent"; properties[3] = "userAgent"; // Loop through the properties, outputting one table row for each one. document.writeln("<table border='0' width='100%' cellpadding='0' cellspacing='0' align='center'>"); for (var index=0;index < number_of_values_to_test;index++) { document.writeln("<td width='200' bgcolor='#eeeeee'><img src='single_bullet.gif' width='10' height='14' alt='*' border='0' align='absmiddle'><font color='#034e7f'>"); document.write(name_array[index]); document.writeln("</font></td>"); document.writeln("<td width='1' bgcolor='#CCCCCC'></td>"); document.writeln("<td bgcolor='#eeeeee'><font color='#034e7f'>"); document.write(navigator[properties[index]]); document.writeln("</font></td></tr>"); } document.writeln("</table>"); </script>
nog eentje
<SCRIPT type="text/javascript" language="JavaScript">
<!-- ;
function detect() {
var naam = navigator.appName;
var versie = navigator.appVersion;
var codenaam = navigator.appCodeName;
alert ( 'De gegevens van jouw browser zijn:' + '\n'
+'Naam:' + naam + '\n'
+'Versie:' + versie + '\n'
+'Codenaam:' + codenaam);
}
// end hide -->
</SCRIPT>
<INPUT type="button" VALUE="Welke browser heb ik???" onClick="detect()">
<SCRIPT type="text/javascript" language="JavaScript"> <!-- ; function detect() { var naam = navigator.appName; var versie = navigator.appVersion; var codenaam = navigator.appCodeName; alert ( 'De gegevens van jouw browser zijn:' + '\n' +'Naam:' + naam + '\n' +'Versie:' + versie + '\n' +'Codenaam:' + codenaam); } // end hide --> </SCRIPT> <INPUT type="button" VALUE="Welke browser heb ik???" onClick="detect()">
[edit]
nog eentje
<!---tussen head--->
<head>
<script language="JavaScript" type="text/javascript">
<!--
var getBrowser = navigator.userAgent.toLowerCase();
var browsernaam;
function checkBrowser(naam)
{
place = getBrowser.indexOf(naam) + 1;
return place;
}
if (checkBrowser('konqueror'))
{
browsernaam = "Konqueror";
}
else if (checkBrowser('safari')) browsernaam = "Safari"
else if (checkBrowser('omniweb')) browsernaam = "OmniWeb"
else if (checkBrowser('opera')) browsernaam = "Opera"
else if (checkBrowser('webtv')) browsernaam = "WebTV";
else if (checkBrowser('icab')) browsernaam = "iCab"
else if (checkBrowser('firefox')) browsernaam = "FireFox"
else if (checkBrowser('msie')) browsernaam = "Internet Explorer"
else if (checkBrowser('netscape')) browsernaam = "Netscape Navigator"
else if (!checkBrowser('compatible'))
{
browsernaam = "Mozilla browser"
}
else browsernaam = "Onbekende browser";
//-->
</script>
</head>
<!---tussen body--->
<body>
<script type="text/javascript">
document.write(browsernaam);
</script>
</body>
<!---tussen head---> <head> <script language="JavaScript" type="text/javascript"> <!-- var getBrowser = navigator.userAgent.toLowerCase(); var browsernaam; function checkBrowser(naam) { place = getBrowser.indexOf(naam) + 1; return place; } if (checkBrowser('konqueror')) { browsernaam = "Konqueror"; } else if (checkBrowser('safari')) browsernaam = "Safari" else if (checkBrowser('omniweb')) browsernaam = "OmniWeb" else if (checkBrowser('opera')) browsernaam = "Opera" else if (checkBrowser('webtv')) browsernaam = "WebTV"; else if (checkBrowser('icab')) browsernaam = "iCab" else if (checkBrowser('firefox')) browsernaam = "FireFox" else if (checkBrowser('msie')) browsernaam = "Internet Explorer" else if (checkBrowser('netscape')) browsernaam = "Netscape Navigator" else if (!checkBrowser('compatible')) { browsernaam = "Mozilla browser" } else browsernaam = "Onbekende browser"; //--> </script> </head> <!---tussen body---> <body> <script type="text/javascript"> document.write(browsernaam); </script> </body>
[/edit] |