Co tydzień nowa porada dla webmastera
Szczegóły
o przeglądarce
podana jest nazwa przeglądarki, wersja, platforma
W sekcji HEAD:
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original: Hamid F. Fard (hamid@petanet.com ) -->
<!-- Web Site: http://www.petanet.com -->
<!-- Begin
var ScrnSize = "UnCommon"
if (navigator.appVersion.indexOf("4.") != -1 &&
navigator.appName.indexOf("Explorer") != -1) {
ScrnSize = screen.width + "x" + screen.height;
}
if (navigator.appVersion.indexOf("4.") != -1 &&
navigator.appName.indexOf("Netscape") != -1) {
ScrnSize = screen.width + "x" + (screen.height + 19); //Netscape sees 19 pixels less on Height
}
switch(ScrnSize) {
case "640x480": document.write('<body bgcolor="#FF0000" text="#000000">');
case "800x600": document.write('<body bgcolor="#00FF00" text="#000000">');
case "1024x768": document.write('<body bgcolor="#0000FF" text="#000000">');
case "1152x864": document.write('<body bgcolor="#FFFF00" text="#000000">');
case "1280x1024": document.write('<body bgcolor="#AA0000" text="#000000">');
case "1600x1200": document.write('<body bgcolor="#FF00FF" text="#000000">');
case "1600x1280": document.write('<body bgcolor="#00AA00" text="#000000">');
default: document.write('<body bgcolor="#FFFFFF" text="#000000">');
}
// The following 3 lines are for display only. They can safely be removed.
document.write('Browser Type=' + navigator.appName + '<BR>');
document.write('Browser Version=' + navigator.appVersion + '<BR>');
document.write('Screen Resolution=' + screen.width + "x" + screen.height);
// End -->
</script>