Redirect [removed] from javascript script

前端 未结 4 1199
面向向阳花
面向向阳花 2021-02-11 05:12

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 05:57

    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;".

提交回复
热议问题