0

I wanted to know what is the primal event to use for injecting HTML code.
the Javascript code itself is injected using a chrome extension.

the HTML code is a message which should appear on top any other HTML. moreover, it should appear to the user before the other html elements or as soon as possible.

I've looked for the right event and stumble upon with DOMContentLoaded. The problem is, the <div id="message"> is rendered after all the dom tree has loaded and that's not good enough for me.

is there another event for this cause?
Thanks!

p.s. HTML5 is an option for me if needed..

captain dragon
  • 959
  • 1
  • 7
  • 8

1 Answers1

0

Well, jQuery have $(document).ready() function which is fired, when all DOM elements are ready. It is faster than window.onload function. Here is question about how get document.ready in clean JavaScript: $(document).ready equivalent without jQuery

Community
  • 1
  • 1
instead
  • 2,324
  • 1
  • 23
  • 30