Skip to content

Instantly share code, notes, and snippets.

View XuDongling's full-sized avatar

xdl XuDongling

  • Beijing
View GitHub Profile
@tao4yu
tao4yu / window_onLoad.js
Last active June 5, 2017 01:45
Javascript : window.onload 绑定多个事件
/*
*假设有2个函数firstFunction和secondFunction需要在网页加载完毕时执行, 需要绑定到window。onload。如果通过:
*
* window.onload = firstFunction;
* window.onload = secondFunction;
* 结果是只有secondFunction会执行,secondFunction会覆盖firstFunction。
*/
/*
*正确的方式是: