I used to do it this way, but I now prefer to set the src up at the top and then define the onload callback. Seems cleaner to me that way. But its a style matter that is up to you.