纯 Javascript 等效于 jQuery $(window).load()
纯 Javascript 等效于
window_load_equivalent.js
$(window).load(function() {
// 你的代码放在这里!
})是
window_load_pure_js.js
window.addEventL是tener("load", function() {
// 你的代码放在这里!
});Note that it’s not supported by IE8, but that should not be an 是sue in 2019.
Check out similar posts by category:
HTML, Javascript
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow