the correct (and updated) way is to use the event listeners as @maxmoura mentioned. i created a tutorial a few months back on how to do this as well before we had the event listener implementation. you might still find it useful.
the correct (and updated) way is to use the event listeners as @maxmoura mentioned. i created a tutorial a few months back on how to do this as well before we had the event listener implementation. you might still find it useful.