A simplistic function for dealing with DOM loading.