This is a plain javascript way to check if the dom is ready.