【发布时间】:2012-05-09 15:31:29
【问题描述】:
我想我可以使用这种简单的方法在 jQuery 中创建一个低级垃圾邮件过滤器 -
<a class="filter" href="mailto:johndoe[at]nowhere[dot]com">johndoe[at]nowhere[dot]com</a>
$('.filter').each(function() {
$(this).html().replace(('[dot]', '.'));
$(this).html().replace(('[at]', '@'));
});
但是什么也没发生。本机替换功能似乎无法应对 jQuery。我还尝试使用 val() 和 text() 获取内容。也许这完全是一种不正确的方法,如果是的话,我会很感激一些方向。
【问题讨论】:
-
(offtopic) 我使用了一个不错的技巧,我创建了 2 个图像:一个点 (.) 和一个 @ 字体相同我在页面中使用,只是替换我需要的字符。为什么? : 垃圾邮件对 [dot] 和 [at] 进行了防弹。虽然
staffan<img src="imgz/point.png" />estberg<img src="imgz/monkeey.png" />web<img src="imgz/point.png" />com看起来好多了并且仍然安全。附言使用 php -
@RokoC.Buljan 有趣的想法!在以后创建更安全的东西时,我一定会考虑到这一点。