Try call it in a normal plugin command. I can't guarantee how it'd behave if you call it differently than how it was designed to.
Also from the javascript you had, I don't think it's correct, as eventId didn't have an id.