Delay callback until script is added to document?

后端 未结 4 2198
名媛妹妹
名媛妹妹 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:43

    Easiest way will be define some visible callback() function which will run in your dynamicly included script, at the end.

提交回复
热议问题