Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!