Move event js into page