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
  • 11,863
  • 24
  • 98
  • 186

1 Answers1

1

Check the function(). docs

window.onload = function() {
  setTimeout(function(){alert("Page Rendered")}, 200000);
};
Roy Bogado
  • 4,219
  • 1
  • 13
  • 30