Redirect [removed] from javascript script

前端 未结 4 1956
渐次进展
渐次进展 2021-02-11 05:37

We want to serve ads on our site but the adserver we are in talks with has issues with delivering their advertising fast enough for us.

The issue as I see it is that we

4条回答
  •  终归单人心
    2021-02-11 06:01

    To decouple the main page loading from the ad loading, you can put the ad in its own page in an iframe or, similarly, download the script file with AJAX and execute it whenever it comes down. If the former is not adequate, because of referring URI or whatever, the latter gives you some flexibility: you could use string replacement to rewrite "document.write" to something else, or perhaps temporarily replace it like "document.write = custom_function;".

提交回复
热议问题