Because there was never an 'on' function. It's an error in the example.