Updated js to use modern ``on``