I have a jQuery function with even.preventDefault() applied to a click on any element with the class 'editable'.
It's not preventing gmail from opening up it sweb interface to send an email, however. It works on systems where default mail behaviour is not set up (the one I was primarily testing on).. not sure about when it's run through Outlook or an actual mail application.
Is there some workaround for this?
$('.editable').not('video, img, textarea').click(function(event) {
event.preventDefault();
loadEditor($(this));
});
edit: I have also tried with event.stopPropagation(); but it is still going through.
The gmail interface event handling is probably happening in-browser, so try calling event.stopPropagation too.
try adding return false,
$('.editable').not('video, img, textarea').click(function(event) {
event.preventDefault();
loadEditor($(this));
return false;
});
event.preventDefault() vs. return false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With