I have an article in Joomla 2.5 that has JavaScript in it. And within the JS I have a text string holding an email:
var my_email = "a@b.com" ;
this string triggers the email cloaking plugin built into Joomla. Of course when I disable the plugin, then there is no problem. But I do not want to disable it, as other parts of the site will benefit from it.
Is there another solution? Apparently there is a PHP class that offers this:
echo JHtml::_('email.cloak', 'demo@example.com');
You can disable the cloak with in a single article by using this tag {emailcloak=off}
This will only affect the article that you place the tag in — it doesn't matter where the tag goes it disables it for the whole article. (The tag is stripped out at the same time).
Of course this means the address you have in Javascript will be visible to bots.