[removed] vs [removed]

后端 未结 9 1283

Which is more widely supported: window.onload or document.onload?

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-21 06:05

    Add Event Listener

    
    


    Update March 2017

    1 Vanilla JavaScript

    window.addEventListener('load', function() {
        console.log('All assets are loaded')
    })
    


    2 jQuery

    $(window).on('load', function() {
        console.log('All assets are loaded')
    })
    


    Good Luck.

提交回复
热议问题