void SomeFunc(nsIDOMEvent* aEvent) {...} pHost->AddEventListener("element-id", "click", SomeFunc);
class MyObject : MagicBase { public: void addData(string) {...} }; MyObject* pObj = new MyObject; pHost->AddObject("special", pObj); //--------------------------------------- <input type="text" onblur="blurHandler(event);"/> function blurHandler(aEvent) { window.special.addData(aEvent.target.value); }