我是一个新手,我正在玩试图用javascript实现一些东西.
我有一个功能,我需要在我的页面加载后生效,但我不想使用<body onload="init()"是否有另一种选择?
<script type="text/javascript">
function init() {
container = document.createElement('div');
<script>
<body onload="init()">
</body>
Run Code Online (Sandbox Code Playgroud)