User blog comment:Airhogs777/iOS touch icon customization/@comment-876022-20111210070208/@comment-13301-20111210104821

You can't addOnloadHook( setappleicon ); when is still undefined. You must declare setappleicon function first and then reference it.