I’m looking for some input on how to implement custom eventhandling in jquery the best way. I know how to hook up events from the dom elements like ‘click’ etc, but I’m building a tiny javascript library/plugin to handle some preview functionality.
I’ve got a script running to update some text in a dom element from a set of rules and data/user input I got, but now I need that same text shown in other elements that this script can’t possibly know of. What I need is a good pattern to somehow observe this script producing the needed text.
So how do I do this? Did I overlook some builtin functionality in jquery to raise/handle user events or do I need some jquery plugin to do it? What do you think is the best way/plugin to handle this?