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

135
Vistas
Scripts won't run on internet explorer 11 (ie11)

I have a script below

var dt = new Date();
year  = dt.getFullYear();
month = (dt.getMonth() + 1).toString().padStart(2, "0");
day   = dt.getDate().toString().padStart(2, "0");

document.getElementById("date").innerHTML = year+"."+month+"."+day;

It's a simple script that displays current date (year, month and day).

The problem is that for some reason it won't work on internet explorer 11. (I have javascript enabled). On browsers like mozilla, chrome it works fine. Maybe the script should be differently written just for ie11?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

The issue is that you are using .padStart method that is not supported by the IE

You should check can i use before dealing with IE :)

As an option, you can use the polyfill from MDN or from here. And here is EN version for the padStart

In case you have to support IE in production, I would advise you to check transpilers (babel as example) It allows you to use modern code without worrying about old browsers. The downside is that configuration might be a bit tricky. But it really worth it.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Internet Explorer 11 is too old to support padStart.

You should have seen an error message about it being undefined when you looked at the developer tools when you debugged your code in IE. You did debug it, didn't you?

It is a legacy browser that Microsoft only provides for the benefit of out-of-date intranet based web applications.

MDN links to a couple of polyfills if you really need to support it in new development. As a rule of thumb, you should be working to eliminate it from your organisation instead.

about 4 years ago · Juan Pablo Isaza Denunciar
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