Loading JavaScript Into Div Dynamically

前端 未结 6 1156
难免孤独
难免孤独 2021-01-22 15:32

I need to load JavaScript code (which I don\'t have control over) from a URL into a div. The JavaScript code is a bunch of document.write() statements. Once the document.write()

6条回答
  •  时光说笑
    2021-01-22 16:02

    $.getScript('foo.js', function() {
     alert('foo.js was loaded, do something cool now');
    });
    

提交回复
热议问题