Updated sample JS function to use on() as live() is deprecated