add javascript handler to log poll info to DB