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
$(document).ready(handler);
use
$(document).bind('ready', handler);
then whenever you want to change the existing event handler use:
$(document).unbind('ready', handler);//when there is reference to the handler
or
$(document).unbind('ready');//to remove all handlers for ready event
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:
var GD_EVENT_NAMESPACE = ".GrelaDesign";
$document.bind('ready' + GD_EVENT_NAMESPACE, function(){ alert('ready'); });
//later
$document.unbind('ready' + GD_EVENT_NAMESPACE);//this will remove only specific events
best regards
p.s. I was searching extensively before asking here:) and soon after I've asked I've found on bing the answer:-)
$(document).ready()
multiple times, so there's nothing stopping you from treating it as if there were no other handlers active if you just need to do your own stuff. – Tericaterina:)
– Hereunder