Avoid having your HTML know about your Javascript. In this case I would listen on the [documents ready state change](https://developer.mozilla.org/en-US/docs/Web/Reference/Events/readystatechange)