Fix a bug in javascript event.