handling trip clicks with javascript