site de Fabien Torre


Source de ancres.html

1: <HTML> 2: <HEAD> 3: <TITLE>Ouverture d'une page d'ancres</TITLE> 4: <link REL="stylesheet" TYPE="text/css" HREF="https://fabien-torre.fr/include/css/ft-v1.css"> 5: <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> 6: <SCRIPT LANGUAGE="JavaScript"> 7: function ListeAncres (d) { 8: 9: var newwin = window.open("","menu","menubar=no,width=300,height=150"); 10: 11: newwin.document.write("<HTML><HEAD><TITLE>Navigation</TITLE></HEAD><BODY>"); 12: newwin.document.write("<H1>Navigation : "+d.title+"</H1>"); 13: 14: for (var i=0 ; i < d.anchors.length ; i++) { 15: 16: newwin.document.write('<A HREF="" onClick="opener.location.hash=\''+d.anchors[i].name+'\';return false;">'); 17: 18: 19: if (navigator.appName.indexOf("Microsoft") == -1) { 20: newwin.document.write(d.anchors[i].text); 21: } else { 22: newwin.document.write(d.anchors[i].innerText); 23: } 24: 25: newwin.document.write("</A><BR>"); 26: 27: 28: } 29: 30: 31: newwin.document.write("</BODY></HTML>"); 32: 33: newwin.document.close(); 34: 35: 36: } 37: </SCRIPT> 38: </HEAD> 39: 40: <BODY> 41: <DIV CLASS="menu"> 42: <DIV CLASS="partmenu"> 43: <UL> 44: <LI> voir le <A HREF="https://fabien-torre.fr/Enseignement/tp/JavaScript/ancres.html.src">code de cette page</A> 45: <LI> retour à la page des 46: <A HREF="https://fabien-torre.fr/Enseignement/tp/JavaScript/">Travaux pratiques JavaScript</A> 47: <LI> retour à la page de <A HREF="https://fabien-torre.fr/">Fabien Torre</A> 48: </UL> 49: </DIV> 50: </DIV> 51: <DIV CLASS="page"> 52: 53: <H1>Ouverture d'une page d'ancres</H1> 54: 55: <H2><A NAME="haut">au début</A></H2> 56: <SCRIPT LANGUAGE="JavaScript"> 57: for (var i=0 ; i<=50 ; i++) { 58: document.write(i+'<BR>'); 59: } 60: </SCRIPT> 61: 62: 63: <H2><A NAME="milieu">au milieu</A></H2> 64: <SCRIPT LANGUAGE="JavaScript"> 65: for (var i=0 ; i<=50 ; i++) { 66: document.write(i+'<BR>'); 67: } 68: </SCRIPT> 69: 70: 71: <H2><A NAME="bas">en bas</A></H2> 72: <SCRIPT LANGUAGE="JavaScript"> 73: for (var i=0 ; i<=50 ; i++) { 74: document.write(i+'<BR>'); 75: } 76: </SCRIPT> 77: 78: 79: <SCRIPT LANGUAGE="JavaScript"> 80: ListeAncres(document); 81: 82: 83: 84: for (var i=0 ; i < document.anchors.length ; i++) { 85: 86: document.write('<A HREF="" onClick="location.hash=\''+document.anchors[i].name+'\';return false;">'); 87: 88: 89: if (navigator.appName.indexOf("Microsoft") == -1) { 90: document.write(document.anchors[i].text); 91: } else { 92: document.write(document.anchors[i].innerText); 93: } 94: 95: document.write("</A><BR>"); 96: } 97: </SCRIPT> 98: 99: 100: <BR><BR><BR> 101: </DIV> 102: </BODY> 103: </HTML>
Fabien Torre Valid HTML5! Valid CSS!
site de Fabien Torre, université de Lille