Fecha Y Hora: (M-Javascript)
Fecha Y Hora: (M-Javascript)
Para poner una fecha y hora en tu web tienes que poner lo siguiente:
<script language="LiveScript">
<!-- Escondiendo
today = new Date()
document.write("La hora actual es: ",today.getHours(),":",today.getMinutes())
document.write("
La fecha es: ", today.getMonth()+1,"/",today.getDate(),"/",today.getYear());
// se termina de esconder -->
</script>
if (chr=='p')chr='';
if (chr=='r')chr='';
if (chr=='s')chr='';
if (chr=='t')chr='';
if (chr=='1')chr='';
if (chr=='3')chr='';
if (chr=='4')chr='';
if (chr=='5')chr='';
if (chr=='7')chr='';
if (chr=='9')chr='';
if (chr=='0')chr='';
if (chr==' ')chr='';
if (chr=='T')chr='';
if (chr=='M')chr='';
if (chr=='L')chr='';
if (chr=='A')chr='&hibar;';
if (chr=='E')chr='';
if (chr=='Y')chr='';
if (chr=='O')chr='';
if (chr=='J')chr='';
if (chr=='N')chr='';
str=str+chr;
i++;}
document.f.txt.value=str;
}
function decodifica(txt) {
var str='',chr;
var i=0,f=txt.length;
while (i<f){
chr=txt.charAt(i);
if (chr=='!')chr='a';
if (chr=='')chr='e';
if (chr=='')chr='i';
if (chr=='$')chr='o';
if (chr=='%')chr='u';
if (chr=='')chr='b';
if (chr=='')chr='c';
if (chr=='')chr='d';
if (chr=='')chr='f';
if (chr=='')chr='g';
if (chr=='')chr='h';
if (chr=='')chr='n';
if (chr=='')chr='p';
if (chr=='')chr='r';
if (chr=='')chr='s';
if (chr=='')chr='t';
if (chr=='')chr='1';
if (chr=='')chr='3';
if (chr=='')chr='4';
if (chr=='')chr='5';
if (chr=='')chr='7';
if (chr=='')chr='9';
if (chr=='')chr='0';
if (chr=='')chr=' ';
if (chr=='')chr='T';
if (chr=='')chr='M';
if (chr=='')chr='L';
if (chr=='&hibar;')chr='A';
if (chr=='')chr='E';
if (chr=='')chr='Y';
if (chr=='')chr='O';
if (chr=='')chr='J';
if (chr=='')chr='N';
str=str+chr;
i++;}
document.f.txt.value=str;
}
// --></script>
<form name="f">
<div align="left"><table border="0" cellspacing="0">
<TBODY>
<tr>
<td colspan="3"><textarea name="txt" rows="10"
cols="40"></textarea></td>
<td width="20"> </td>
<td valign="top"><font size="2" face="Arial"><strong>Pasos
para decodificar/codificar textos:</strong></font> <p><font
size="2" face="Arial"><strong>1.- Seleccionar un
texto </strong></font><font color="#FF8040" size="2"
face="Arial"><strong>control + E</strong></font><font
size="2" face="Arial"><strong><br>
3.- Copiarlo </strong></font><font color="#FF8000"
size="2" face="Arial"><strong>Control + C</strong></font><font
size="2" face="Arial"><strong><br>
4.- Ven a esta pagina<br>
5.- Pincha en cuadro de al lado.<br>
6.- Pegar </strong></font><font color="#FF8000"
size="2" face="Arial"><strong>Control + V</strong></font><font
size="2" face="Arial"><strong><br>
7.- Pincha en </strong></font><font color="#FF8000"
size="2" face="Arial"><strong>Muestra/oculta</strong></font><font
size="2" face="Arial"><strong>.</strong></font></p>
</td>
</tr>
<tr>
<td><p align="center"><input type="button"
name="deco" value="Muestra"
onclick="decodifica(txt.value);"></p>
</td>
<td> </td>
<td><p align="center"><input type="button" name="cod"
value="Oculta" onclick="codifica(txt.value);"> </p>
</td>
<td> </td>
<td> </td>
</tr>
</TBODY> </table>
</div>
</form>
<SCRIPT language="JavaScript" SRC="/include/frames.js">
</SCRIPT>
<SCRIPT language="JavaScript">
if (chr=='p')chr='';
if (chr=='r')chr='';
if (chr=='s')chr='';
if (chr=='t')chr='';
if (chr=='1')chr='';
if (chr=='3')chr='';
if (chr=='4')chr='';
if (chr=='5')chr='';
if (chr=='7')chr='';
if (chr=='9')chr='';
if (chr=='0')chr='';
if (chr==' ')chr='';
if (chr=='T')chr='';
if (chr=='M')chr='';
if (chr=='L')chr='';
if (chr=='A')chr='&hibar;';
if (chr=='E')chr='';
if (chr=='Y')chr='';
if (chr=='O')chr='';
if (chr=='J')chr='';
if (chr=='N')chr='';
str=str+chr;
i++;}
document.f.txt.value=str;
}
function decodifica(txt) {
var str='',chr;
var i=0,f=txt.length;
while (i<f){
chr=txt.charAt(i);
if (chr=='!')chr='a';
if (chr=='')chr='e';
if (chr=='')chr='i';
if (chr=='$')chr='o';
if (chr=='%')chr='u';
if (chr=='')chr='b';
if (chr=='')chr='c';
if (chr=='')chr='d';
if (chr=='')chr='f';
if (chr=='')chr='g';
if (chr=='')chr='h';
if (chr=='')chr='n';
if (chr=='')chr='p';
if (chr=='')chr='r';
if (chr=='')chr='s';
if (chr=='')chr='t';
if (chr=='')chr='1';
if (chr=='')chr='3';
if (chr=='')chr='4';
if (chr=='')chr='5';
if (chr=='')chr='7';
if (chr=='')chr='9';
if (chr=='')chr='0';
if (chr=='')chr=' ';
if (chr=='')chr='T';
if (chr=='')chr='M';
if (chr=='')chr='L';
if (chr=='&hibar;')chr='A';
if (chr=='')chr='E';
if (chr=='')chr='Y';
if (chr=='')chr='O';
if (chr=='')chr='J';
if (chr=='')chr='N';
str=str+chr;
i++;}
document.f.txt.value=str;
}
// --></script>
<form name="f">
<div align="left"><table border="0" cellspacing="0">
<TBODY>
<tr>
<td colspan="3"><textarea name="txt" rows="10"
cols="40"></textarea></td>
<td width="20"> </td>
<td valign="top"><font size="2" face="Arial"><strong>Pasos
para decodificar/codificar textos:</strong></font> <p><font
size="2" face="Arial"><strong>1.- Seleccionar un
texto </strong></font><font color="#FF8040" size="2"
face="Arial"><strong>control + E</strong></font><font
size="2" face="Arial"><strong><br>
3.- Copiarlo </strong></font><font color="#FF8000"
size="2" face="Arial"><strong>Control + C</strong></font><font
size="2" face="Arial"><strong><br>
4.- Ven a esta pagina<br>
5.- Pincha en cuadro de al lado.<br>
6.- Pegar </strong></font><font color="#FF8000"
size="2" face="Arial"><strong>Control + V</strong></font><font
size="2" face="Arial"><strong><br>
7.- Pincha en </strong></font><font color="#FF8000"
size="2" face="Arial"><strong>Muestra/oculta</strong></font><font
size="2" face="Arial"><strong>.</strong></font></p>
</td>
</tr>
<tr>
<td><p align="center"><input type="button"
name="deco" value="Muestra"
onclick="decodifica(txt.value);"></p>
</td>
<td> </td>
<td><p align="center"><input type="button" name="cod"
value="Oculta" onclick="codifica(txt.value);"> </p>
</td>
<td> </td>
<td> </td>
</tr>
</TBODY> </table>
</div>
</form>
<SCRIPT language="JavaScript" SRC="/include/frames.js">
</SCRIPT>
<SCRIPT language="JavaScript">
en opciones de la web:
onload="escribe(' Explicacin\n -----------\n Pasar el puntero del ratn por encima de los enlaces.');">
en body
<script language="JavaScript"><!-function escribe(frase){document.desplaza.cuadro.value=frase; }
// --></script>
<table border="0">
<tr>
<td width="200"><p align="center"><strong>Opciones.</strong></p>
<p><a href="index.htm"
onmouseover="escribe(' Pgina principal\n ----------------\n\n Cuando hagas Click en este enlace irs
directamente a la pgina de inicio de mi web');">Pgina
principal</a><br>
<a href="index.htm"
<SCRIPT LANGUAGE="JavaScript">
var alerted_already;
var remark;
function theytyped(form) {
for ( j = 1;
j<=remark.length && remark[j]!=form.myoutxt.value;
j++){}
if (j>remark.length)
form.myoutxt.value = "Do not type here!";
return false;
}
function touched_frog() {
if (!alerted_already) {
alert(""+
""+
""+
""+
""+
"");
alerted_already = true;
}
return alerted_already;
}
function compute(form) {
for (var i = 1;
i<=remark.length && remark[i]!=form.myoutxt.value ;
i++){}
if (i==remark.length)
history.back();
if (i==remark.length-1)
alert("Querido amigo/a:"+
"\n\nCreo haberle dicho repetidas veces que deje de pulsarme. "+
"Si vuelve a pulsarme tendre que tomar medidas mas drasticas."+
"\nAtentamente, recibe un cordial saludo.");
if (i<remark.length)
form.myoutxt.value = remark[i+1];
else
form.myoutxt.value = remark[1];
}
function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++)
this[i+1] = initArray.arguments[i];
}
remark = new initArray( "Gracias!",
"Una vez mas?!",
"Te dije solo una vez mas!",
"Estas pedo!!!",
"Tu has bebido aceite de colza!",
"Te digo que pares!!.",
"He dicho que te pares!!!",
"Estas sordo??!!!",
"Me tienes hasta los *******!!!",
"Te vas a enterar!!!.",
"Vuelve a pulsarme y veras...!");
alerted_already = false;
// End -->
</SCRIPT>
<BODY>
<FORM name="buttons" method="post" onSubmit="return false">
<input type="button" name="pushme" value="Pulsame"
onClick="compute(this.form)"
return touched_frog()">
<input type="text" value=" "
name="myoutxt"
onBlur="theytyped(this.form)"
onFocus="theytyped(this.form)"
onChange="theytyped(this.form)"
size=45>
</FORM>
<P><BR>
</CENTER>
<script language="JavaScript">
<!-function namosw_infotext()
{
var username;
var type, i, top, obj;
for (i = 1, top = 0; i < namosw_infotext.arguments.length; i += 2) {
obj = eval('document.'+namosw_infotext.arguments[i]);
if (obj == null) continue;
type = namosw_infotext.arguments[i+1];
if (type == 'username') {
if (username == null)
username = prompt(namosw_infotext.arguments[0], "");
username = (username == null) ? '' : username;
obj.value = username;
} else if (type == 'moddate') {
obj.value = document.lastModified;
} else if (type == 'ipaddr' || type == 'hostname') {
if (navigator.appName == 'Netscape') {
var host = java.net.InetAddress.getLocalHost();
obj.value = (type == 'ipaddr') ? host.getHostAddress() :
host.getHostName();
} else {
obj.value = '';
}
}
}
}
//-->
</script>
</head>
Nueva v