Loading script tags via AJAX

前端 未结 4 551
渐次进展
渐次进展 2020-12-03 18:45

I have a div tag which is filled with script via an ajax call, but the script does not execute.

Is there a way to cause the script to execute?

4条回答
  •  悲&欢浪女
    2020-12-03 19:08

    I guess, you are writing script tag into innerHTML directly

    This will not work.

    document.body.innerHTML+="
    
                                     
                  
提交回复
热议问题