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

前端 未结 7 1096
星月不相逢
星月不相逢 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:40

    Another procedure is to change the behavior of document.write() function.
    Assume you have the main index.php file:

    
    
    
    
    
    Hello

    and the jsfile.js is like this:

    document.write("OK MAN!");
    

    now if you type doit() in the js browser console to execute that function (and the script do what you wrote) then the result would be:

    Hello
    OK MAN!
    

    In which the html is like this:

    
    
    
    
    Hello
    OK MAN!

提交回复
热议问题