Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is window.onpaint?

Tags:

javascript

Someone recommended here that window.onpaint be used to run some javascript before page load. I've never actually seen this before, could someone explain its usage/usefulness?

like image 778
Kyle Marimon Avatar asked Feb 13 '23 23:02

Kyle Marimon


1 Answers

From the MDN :

onpaint doesn't work currently, and it is questionable whether this event is going to work at all, see bug 239074.

So the usefulness is zero.

It might depend on your exact use case but if you want to run a script "before page load", the simplest solution is probably to put it in the head.

like image 87
Denys Séguret Avatar answered Feb 15 '23 12:02

Denys Séguret