Not allowed [removed] after page load?

后端 未结 1 1187
南方客
南方客 2020-12-22 03:51

I\'ve been told that you can\'t use document.write after a page load, is this true?

I\'ve created an extremely simple Javascript file that gets included from website

相关标签:
1条回答
  • 2020-12-22 04:28

    If you just write to the document itself it'll remove the page content and you'll be left with only the new text.

    Try using:

    document.getElementById('DIVID').innerHTML = "YOUR HTML HERE"
    

    Substitute 'DIVID' for the element that will contain the ad and 'YOUR HTML HERE' for whatever you want to be written to the page). This will also allow you to position the ad on the page more easily.

    0 讨论(0)
提交回复
热议问题