Init the script when the required part of the page has been loaded.