2011/3/28 Mark McDonnell <[email protected]>: > Actually, just looking at this I realised that my standardise method (not > included, but which takes the event object and standardises some of the > responses - such as relatedTarget) is what's causing the issue! It is as > mentioned before an issue of using an anonymous function after all - sorry > for being stupid and not noticing :( > Anyone have any ideas how I could work around this? It was mentioned before > about jQuery collecting the callbacks in an object? > I need the anonymous function when setting the event listener (just so I can > standardise the response), similar I guess to how jQuery does it, so from > there I guess I need to store the callback in some kind of object literal > (or Array?) when setting the event listener, and when I remove the event > listener I try and find the callback function within the object? Is that a > efficient way of doing things? > M.
I've made a somewhat small even handler, with which you can add and remove events. I collect a list of all event handlers for reference, so that they can be easily removed later on. Check it out at https://github.com/Poetro/experiments/tree/master/event -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
