0

I am trying to simulate a script that takes a long time to run on page load.

I tried this:

window.onload = function() {
  setTimeout(alert("Page Rendered"), 200000);
};

But alert message happens instantly.

What am I doing wrong?

Guerrilla
  • 13,375
  • 31
  • 109
  • 210

1 Answers1

1

Check the function(). docs

window.onload = function() {
  setTimeout(function(){alert("Page Rendered")}, 200000);
};
Roy Bogado
  • 4,299
  • 1
  • 15
  • 31