I have to modify site that is using jQuery’s ready handler, I wan’t to reuse code and not have to write it again, however I need to change the behaviour of original ready handler, the question is:
- how to remove ready handler (to apply new one)?
- or how to override existing ready handler (original has anonymous function used)?
best regards
Ok, apparently you can’t unbind the ready handler, to be precise, you can’t when the ready() is used but you can using the bind(‘ready’, handler) so instead of
use
then whenever you want to change the existing event handler use:
or
as I’ve recently found you can add the event namespace:) to only remove ready events in that namespace (i’ve peeked the jplayer code) as follows:
best regards
p.s. I was searching extensively before asking here:) and soon after I’ve asked I’ve found on bing the answer:-)