Delay callback until script is added to document?

后端 未结 4 2206
名媛妹妹
名媛妹妹 2021-01-05 00:08

How can I get the callback to not run until the script is actually appended to the document?

function addScript(filepath, callback){
    if (filepath) {
             


        
4条回答
  •  死守一世寂寞
    2021-01-05 00:35

    In the ideal world, you could use the onload property of the

提交回复
热议问题