Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

217
Vistas
Why is this timer working and not working?

I made a java timer everything works when all the code is in one file and separated. When I start doing anything about it create a separate js file and move the java code there and even when i try to insert it inside php nawiada in both cases it stops working how is it like here it works and it's great. but i want js in js file then it stops working, I think it is about "'these elements but I don't know, I'll tire of the timer, best regards

var secs = 0;
var element = "czas"; 
var T = null;
function count(id)
{
    temp = secs;
    if(secs > 0)
    {
        result = Math.floor(temp) + "  ";
        document.getElementById(element).innerHTML = result;
        secs--;
    }
    else
    {
        document.location="/"
        clearInterval(T);
    }
}
function counter(seconds)
{
    secs = seconds;
    T = window.setInterval("count()", 1000);
}


echo
    '<div id="czas"></div>
    <script type="text/javascript">counter(60);</script>'
;
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda