Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
357 views
in Plugins by
edited by

How can I get the id of the element containing comment, question or answer which is going to be submitted in an event module? for example in the following code I want to add a script related to the comment

class my_event {
	function process_event($event, $userid, $handle, $cookieid, $params) {
		
		if ($event === 'c_post') {
		     echo '<script>
             var Dom = document.getElementById("this comment");
</script>'

}//end process_event }//end class

1 Answer

+1 vote
by

It will be $params['postid'] - see the docs here.

by
Thank you Scott. But how to add javascript? It seemd it is not possible to output html or javascript in event modules.
...