Tagged: onclick
i just discovered that i can’t add this kind of link in a text block…
<a href="#" onclick="mailhidepopup=window.open('https://mailhide.io/e/xxxxx?compact=true','mailhidepopup','width=580,height=635'); return false;" title="Reveal this e-mail address">here</a>
…if i add a text block, then click on the “text” tab instead of the “visual” tab, i can usually add html code. but when i add this little bit of javascript, & leave the text area, it’s all deleted.
is there a way to do such a thing when adding a block of text besides using the code block?
thanks.
upon further research, it seems that this is a pretty widespread issue, & perhaps even intentional.
i found a workaround @ https://kriesi.at/support/topic/onclick-event-on-html-link-dissapears-on-save/
to basically use this as the link in the text block…
<a href="#" id="mailHidePop">on click link</a>
…and add a code block at the bottom of the page with this…
<script>
(function($){
$(window).load(function() {
$("#mailHidePop").on('click', function() {
popup = window.open('https://mailhide.io/e/xxxxxxx?compact=true','mailhidepopup','width=580,height=635');
popup.focus();
return false;
})
});
})(jQuery);
</script>
…and that seems to be working fine.