XModPro

Problem cloaking email addresses on pages...

James Allen Hall James Allen Hall asked Mar 26, 2014
Active Jul 24 · Viewed 1826 times
<p> <p>Kelly was kind enough to provide an example of how one would use xmod:Format to cloak an email address. His example is simple and easy to implement. My final solution below works quite well in most scenarios, EXCEPT when paging is used with AJAX turned on:</p></p><p><em>&lt;span&gt;&lt;xmod:Format Type="cloak" Value='[[MailToWithDisplayAs]]' /&gt;&lt;/span&gt; </em></p><p><em> &lt;xmod:jQueryReady&gt; </em></p><p><em> $('.genericlink').each(function(){ </em></p><p><em> var $this = $(this); </em></p><p><em> $this.find('script').remove(); </em></p><p><em> var genericlinkuri = $this.text().trim(); </em></p><p><em> var parts = genericlinkuri.split("|"); </em></p><p><em> $this.html('&lt;a href="' + parts[0] + '"&gt;' + parts[1] + '&lt;/a&gt;'); </em></p><p><em> }); </em></p><p><em> &lt;/xmod:jQueryReady&gt;</em> </p><p><strong> <p>My guess is that the JS is not executing because the page does not reload.</p><p><strong>Is there a way this can be made to work with AJAX turned on?</strong></p><p></strong></p>

1 Answer

Loading answers...