0

I have some html+java+style codes which required to be loaded only after the whole page is loaded. However, if I use document.write() in window.onload method, it completely clear the whole page and write the new codes.

How can I avoid this? Any other workarounds? Thank you so much.

Kit Ng
  • 993
  • 4
  • 12
  • 24
  • 1
    document.write will start from the clean slate! what do you want to achieve exactly? – Raja CSP Sep 03 '14 at 14:49
  • 2
    Why are you using `document.write` in the first place? It's a legacy and outdated method everyone should forget. In short, it's not to be used in any modern page. – MaxArt Sep 03 '14 at 14:49
  • 2
    You can use innerHTML or appendChild (dom methods) if you want to write. – Raja CSP Sep 03 '14 at 14:51

0 Answers0