Ver Mensaje Individual
  #10 (permalink)  
Antiguo 18/06/2013, 10:47
Avatar de PIRRUMAN
PIRRUMAN
 
Fecha de Ingreso: febrero-2006
Ubicación: Monterrey, Nuevo León
Mensajes: 633
Antigüedad: 18 años, 3 meses
Puntos: 53
Respuesta: Poner Javascript en un lugar deseado de la página

Puedes hacerlo una funcion y despues llamarla en cualquier evento , yo en el ejemplo lo coloque al final , pero puedes ponerlo en el onclick onblur etc
Cita:
<html>
<head>
<title>pruebas</title>
<script languaje="JavaScript">
function CAL(MIID)
{
mesarray=new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio","Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
diaarray=new Array( "Domingo","Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado");
hoy = new Date();
dias = hoy.getDate();
dia = hoy.getDay();
mes = hoy.getMonth();
mes=mesarray[mes];
dia =diaarray[dia];
anno = hoy.getYear();
if (anno <200)
anno = anno+1900;
var MITABLA='<CENTER>';
MITABLA+='<FONT SIZE="2" COLOR="#000000">'+dia+'</FONT><br>';
MITABLA+='<FONT SIZE="4" COLOR="#000000" FACE="Arial"><B>'+dias+'</B></FONT><br>';
MITABLA+='<FONT SIZE="2" COLOR="#000000"> <B>'+mes+'</B></FONT><br>';
MITABLA+='<FONT SIZE="2" COLOR="#000000">'+anno+'</FONT>';
MITABLA+='</CENTER>';
document.getElementById(MIID).innerHTML=MITABLA;
}
</script>
</head>

<body>
<table width="50%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td id="mical"></td>
</tr>
<tr>
<td id="mical2"></td>
</tr>
</table>
<script type="text/javascript">
CAL('mical');
CAL('mical2');
</script>
</body>
</html>
primero prueba colocando la funcion en la misma pagina, despues si lo deseas externo creala en tu archivo js e incluyela
__________________
“Prefiero ser un tonto momentaneo que un eterno ignorante”
“¡El éxito es resultado de los aciertos,los aciertos resultado de la experiencia y la experiencia resultado de los errores!”