0

I want to fire function call on window.onload event. But inside my stackblitz project this is not firing at all.

window.onload = function () {
  console.log('loading...');
};

You can check out the same inside stackblitz demo link here

I have to add this link of stackblitz code demo here because I am having issue with there. Can you suggest a way of correcting this? Thanks.

GRD
  • 208
  • 2
  • 6
  • Use `addEventListener`, and it will work fine. – CBroe Jun 13 '23 at 09:41
  • @CBroe I thinks its not. Check out updated link https://stackblitz.com/edit/js-dantdk?file=index.js console statement is not firing... – GRD Jun 13 '23 at 09:54

0 Answers0