為什么global.width 會的到undefined,網(wǎng)頁的加載順序不是自上而下的嗎?<script>var global = {};
(function(){ var action = function() {
global.width = document.documentElement.clientWidth;
} document.addEventListener("DOMContentLoaded", action, flase);
})();</script><script>
alert(global.width); //undefined ??</script>
js 加載順序的問題?
慕哥6287543
2018-08-08 11:10:26