I know is kind of a dumb question but I'm kinda confused, tried to look up on the internet but couldn't find anything so..
when in JS (ES6) I declare an arrow function as const
, how can I invoke it when page is loaded?
es.
const bigBla = async () => { bla bla };
tried smt like onload="bigBla()"
but doesn't work, also tried to invoke it at the end of the JS file but won't work in the HTML file (need to change innerHTML
of a span element/src of an iframe
, data come from http request), whereas if i declare function bigBla(){...}
and use onload="bigBla()"
i have no problems. Help me :(