$("p").click(function(){alert('clicked')});
$("p").unbind('click');
Within greasemonkey the click event does not unbind. I believe this is caused by greasemonkey's security model wrapping the associated event object from the first line in XPCNativeWrapper, causing the second line to be unable to "find" it. However, I can't seem to find a workaround. Any suggestions?
UPDATE: Something like the following does work in greasemonkey. So I'm still thinking it's an XPCNativeWrapper issue that I can't find a way to resolve.
$("p").click(function(){alert('clicked'); $(this).unbind('click')});