Handle event types in sendJavascript().