[removed] capturing load event on LINK

后端 未结 9 1319
没有蜡笔的小新
没有蜡笔的小新 2020-11-29 01:00

i\'m trying to attach an event handler to the load event of a link tag, to execute some code after a stylesheet has loaded.

new_element = document.createElem         


        
9条回答
  •  遥遥无期
    2020-11-29 01:55

    An href does not have a load event you need to apply your stuff as the page itself loads e.g.

    window.onload = function(){
    //code here
    
    }
    

    use the function on this page: http://www.dustindiaz.com/top-ten-javascript/

    to add the event the body element (in line would be )

提交回复
热议问题