Afficher la version du Navigateur



Résultat :

Detection De Votre B rowser












Appel

<CENTER> <STRONG><EM><FONT COLOR="#0000FF" SIZE=+3>D</FONT><FONT COLOR="#0000FF" SIZE=+2>etection </FONT> <FONT COLOR="#0000FF" SIZE=+3>D</FONT><FONT COLOR="#0000FF" SIZE=+2>e Votre </FONT> <FONT COLOR="#0000FF" SIZE=+3>B</FONT> <FONT COLOR="#0000FF" SIZE=+2>rowser</FONT></EM></STRONG></CENTER> <HR WIDTH=300 ALIGN=center SIZE=2><BR><BR><CENTER> <FORM NAME="detect"> <INPUT TYPE="text" NAME="browser" SIZE=25 MAXLENGTH=40 VALUE=" Scanning Detection"><BR> <BR><BR> <INPUT TYPE="button" VALUE="Nom" onClick="getBrowserName()"> <INPUT TYPE="button" VALUE="Version" onClick="getBrowserVersion()"> <INPUT TYPE="button" VALUE="Code" onClick="getBrowserCodeName()"> <INPUT TYPE="button" VALUE="Code / Version" onClick="getBrowserUserAgent()"><BR><BR><BR> <INPUT TYPE="button" VALUE="Nom / Version" onClick="getBrowserNameVersion()"><BR><BR><BR> </FORM> </CENTER>

Code source

<SCRIPT> <!-- Activate Cloaking Device //**************************************************// // Browser Dection Example // // by Tim Wallace (timothy@essex1.com) // //************************************************** function getBrowserName() { document.forms[0].elements[0].value =navigator.appName; } function getBrowserVersion() { document.forms[0].elements[0].value = navigator.appVersion; } function getBrowserCodeName() { document.forms[0].elements[0].value = navigator.appCodeName; } function getBrowserUserAgent() { document.forms[0].elements[0].value = navigator.userAgent; } function getBrowserNameVersion() { document.forms[0].elements[0].value = navigator.appName + " " + navigator.appVersion; } // Deactivate Cloaking Device --> </SCRIPT>

Afficher l'heure



Appel :

Voici l'heure : / The current time is: <SCRIPT>document.write(Temp);</SCRIPT>

Résultat :

Voici l'heure : / The current time is:

Code source :

Images compteur à sauvegarder dans votre répertoire :


NB. d'autres images sont disponibles sur le site de Russ

<SCRIPT LANGUAGE="JavaScript"> <!-- /* Copyright 1996, by Gordon McComb. All Rights Reserved. You may use this JavaScript example as you see fit, as long as the copyright notice above is included in your script. This example is from "The JavaScript Sourcebook, from Wiley Computer Books. */ var Temp; setClock(); function setClock() { var OpenImg = '<IMG SRC="../'+pathOnly(location.href)+'dg' var CloseImg='.gif" HEIGHT=21 WIDTH=16>' Temp = "" now = new Date(); var CurHour = now.getHours(); var CurMinute = now.getMinutes(); now = null; if (CurHour >= 12) { CurHour = CurHour - 12; Ampm = "pm"; } else Ampm = "am"; if (CurHour == 0) CurHour = "12" if (CurMinute < 10) CurMinute = "0" + CurMinute else CurMinute = "" + CurMinute CurHour = "" + CurHour; //CurHour = new String (CurHour); //CurMinute = new String (CurMinute); for (Count = 0; Count < CurHour.length; Count++) { Temp += OpenImg + CurHour.substring (Count, Count+1) + CloseImg } Temp += OpenImg + "c" + '.gif" HEIGHT=21 WIDTH=9>' for (Count = 0; Count < CurMinute.length; Count++) { Temp += OpenImg + CurMinute.substring (Count, Count+1) + CloseImg } Temp += OpenImg + Ampm + CloseImg } function pathOnly (InString) { LastSlash=InString.lastIndexOf ('/', InString.length-1) OutString=InString.substring (0, LastSlash+1) return (OutString); } //--> </SCRIPT>

Modifier l'affichage d'un texte



Résultat :

Appel

<SCRIPT LANGUAGE="JavaScript">
<!-- Fade("--<Texte mis en EVIDENCE<!--");
//-->
</SCRIPT>

Code source

<SCRIPT LANGUAGE="JavaScript"><!-- // Feel free to modify or copy this Script for non-commercial use, but please leave this comment in the code. // To use the Fade()-function in HTML-code, always include the HTML-comment-tags to the output-string!!! // This is not necessary for Browsers understanding Java, but to display the text in other browsers too, they are needed! // Nice trick, eh? // // written and (c) by Mathias Hoeschen, Tel./FAX: +49 30 6283675, maze@tfh-berlin.de, Home: http://www.tfh-berlin.de/~maze/ // on 20.Feb.1996 function MakeArray(n){ this.length=n; for(var i=1; i<=n; i++) this[i]=i-1; return this } hex=new MakeArray(16); hex[11]="A"; hex[12]="B"; hex[13]="C"; hex[14]="D"; hex[15]="E"; hex[16]="F"; function ToHex(x){ // Converts a int to hex (in the range 0...255) var high=x/16; var s=high+""; //1. s=s.substring(0,2); //2. These three lines do the same as a 'trunc'-function (because there is no trunc, unfortunately!) high=parseInt(s,10); //3. var left=hex[high+1]; // left part of the hex-value var low=x-high*16; // calculate the rest s=low+""; //1. s=s.substring(0,2); //2. see above low=parseInt(s,10); //3. var right=hex[low+1]; // right part of the hex-value var string=left+""+right; // put the high and low together return string; } function Fade(text){ text=text.substring(3,text.length-4); // removes the HTML-comment-tags color_d1=1 ; // can be any value in 'begin'...255 mul=color_d1/text.length; for(i=0;i<text.length;i++){ color_d1=100*Math.sin(i/(text.length/3)); // "=255-mul*i" to fade out, "=mul*i" to fade in, or try "255*Math.sin(i/(text.length/3))" color_h1=ToHex(color_d1); color_d2=260-mul*i; color_h2=ToHex(color_d2); document.write("<FONT COLOR='#FF"+color_h1+color_h2+"'>"+text.substring(i,i+1)+'</FONT>'); } } //--> </SCRIPT>


Index