Ver Mensaje Individual
  #6 (permalink)  
Antiguo 12/03/2014, 12:18
Toninito
 
Fecha de Ingreso: abril-2010
Mensajes: 40
Antigüedad: 14 años
Puntos: 0
Respuesta: Ejecutar funcion al cargar página

Muchas gracias por sus respuestas jarios, PHPeros y andresgarciadev

me funciono justo como lo necesitaba

Dejo el codigo completo por si alguien mas lo llegara a utilizar

Código HTML:
...
<head>
...
<script type="text/javascript">
function getWeekNr(){
    var now=new Date(),i=0,f,sem=(new Date(now.getFullYear(), 0,1).getDay()>0)?1:0;
    while( (f=new Date(now.getFullYear(), 0, ++i)) < now ){
        if(!f.getDay()){
            sem++;
        }
    }
    return sem;
}
</script>
</head>
<body>
<input name="semana" type="text" class="tb836" id="semana" size="5" readonly="readonly" />
<script>
document.getElementById('semana').value=getWeekNr();
</script>
</body>
...