Move JavaScript to past events.