How to load third-party javascript tag asynchronously which has [removed]

前端 未结 7 1088
星月不相逢
星月不相逢 2021-01-04 07:16

We give out a piece of javascript tags such as which site owners put on their site like http://exa

7条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-04 07:24

    Document.write will not work from async script because document is already loaded when script starts working.

    But you can do this:

    document.body.innerHTML = document.body.innerHTML + '

    Some HTML

    ';

提交回复
热议问题