Message from JavaScript discussions

September 2018

β€” Im on the rightπŸ˜…

β€” 

Hello, I'm pretty new to javascript. I have this line of html that should call the onload after loading the element:

<div id="button" align="middle" onload="console.log('hello')"></div>

But it doesn't output anything to the console. Why? How can I fix it?

β€” I don't think onload works for every element

β€” Only body and img and certain others

β€” Ah, okay. Thank you a lot!

β€” Https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded

β€” Https://jsperf.com/hasownprop-vs-exact-falsee/1

β€” Https://jsperf.com/falsy-vs-exact-false/1

β€” Meh, not large enough of a difference to even care

β€” Ye, cool. im designing callback object (with callback functions), so made those. first doesnt matter how to check, second shows that it (the callback) should be defined explicitly on the object (for better performance).

Message permanent page

β€” Https://ssobczak.wordpress.com/2014/02/16/prototype-vs-closure-js/

β€” Ha ha. now closure factory is faster in chrome🀀