Replace onLoadEnd for IE-compatibility