44. Apertura de página y móvil
Agregue el siguiente código al área <body>
| <Script language = "javaScript"> <!- Comienza para (t = 2; t> 0; t--) { para (x = 20; x> 0; x--) { para (y = 10; y> 0; y--) { parent.moveby (0, -x); } } para (x = 20; x> 0; x--) { para (y = 10; y> 0; y--) { parent.moveby (0, x); } } para (x = 20; x> 0; x--) { para (y = 10; y> 0; y--) { parent.moveby (x, 0); } } para (x = 20; x> 0; x--) { para (y = 10; y> 0; y--) { parent.moveby (-x, 0); } } } //-> // fin -> </script> |
45. Muestre la fecha y hora de la máquina del cliente personal
| <script language = "Livescript"> <!- escondido hoy = nueva fecha () *** ("El tiempo presente es:", Today.gethours (), ":", Today.getMinutes ()) *** ("<br> La fecha de hoy es:", Today.getMonth ()+1, "/", Today.getDate (), "/", Today.getyear ()); // finalizar el contenido de ocultación -> </script> |
46. Genere automáticamente la última fecha modificada para usted cada vez:
| <html> <Body> Esta es una simple página HTML. <br> Últimos cambios: <script language = "Livescript"> <!- Ocultar guión de viejos navegadores *** (document.lastModified) // finalizar el contenido de ocultación -> </script> </body> </html> |
47. restricciones que no pueden estar vacías y direcciones de correo electrónico:
| <html> <Evista> <script language = "javaScript"> <!- escondite función test1 (form) { if (form.text1.value == "") alerta ("No escribiste nada, ¡por favor, ingrese de nuevo!") demás { alerta ("hola"+form.text1.value+"! ¡Lo has entrado completo!"); } } función test2 (form) { if (form.text2.value == "" || form.text2.value.indexof ('@', 0) == -1) alerta ("¡Esta no es la dirección de correo electrónico correcta! ¡Por favor, ingrese nuevamente!"); else alerta ("¡Lo has entrado completo!"); } // -> </script> </ablo> <Body> <form de nombre = "primero"> Ingrese su nombre: <br> <input type = "text" name = "text1"> <input type = "button" name = "button1" value = "test test" onClick = "test1 (this.form)"> <p> Ingrese su dirección de correo electrónico: <br> <input type = "text" name = "text2"> <input type = "button" name = "button2" valor = "test test" onClick = "test2 (this.form)"> </body> |
48. Luz de carreras de caballos
| <html> <Evista> <script language = "javaScript"> <!- escondite var scrtxt = "¡Cómo es! ¡Es genial! También puedes probarlo."+"Aquí va tu mensaje los visitantes de tu La página "+" verá horas en pura fascinación ... "; var lentxt = scrtxt.length; ancho var = 100; var Pos = 1-ancho; función scroll () { pos ++; var scroller = ""; if (pos == lentxt) { pos = 1 ancho; } if (pos <0) { para (var i = 1; i <= math.abs (pos); i ++) { Scroller = Scroller+"";} scroller = scroller+scrtxt.substring (0, ancho-i+1); } demás { scroller = scroller+scrtxt.substring (pos, ancho+pos); } Window.status = Scroller; setTimeOut ("scroll ()", 150); } //-> </script> </ablo> <Body onload = "scroll (); return true;"> ¡Su página web se puede mostrar aquí! </body> </html> |
49. Use botones en la página web para controlar la visualización de la página anterior, la página siguiente y la página de inicio.
| <html> <Body> <Form de nombre = "ButtonBar"> <Input type = "button" value = "back" onClick = "History.back ()"> <Input type = "button" value = "js- home" onClick = "ubicación = 'script.html'"> <Input type = "button" value = "next" onClick = "History.forward ()"> </form> </body> </html> |
50. Verifique el código fuente de una determinada URL
Agregue el siguiente código al área <body>
| <script> función add () { var ress = document.forms [0] .luxiaoqing.value Window.location = "View-Source:"+Ress; } </script> Ingrese la dirección de URL para ver el código fuente: <Form> <input type = "text" name = "luxiaoqing" size = 40 value = "http: //"> </form> <Form> <br> <Input type = "button" value = "ver código fuente" onClick = add ()> </form> |
51. Fecha de pantallas de título
Agregue el siguiente código al área <body>:
| <script language = "javaScript1.2"> <!-escondite var isnmonth = nuevo Array ("enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre") ; var es isday = nuevo Array ("domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"); hoy = nueva fecha (); Año = Today.getYear (); Date = Today.getDate (); if (document.all) document.title = "Today is:"+año+"año"+isnmonth [Today.getMonth ()]+fecha+"día"+isnday [Today.getday ()] //-Ocultar-> </script> |