$html =~ s|(<[aA]\b # <a [^<>]*\b # any attributes [hH][rR][eE][fF]=\"? # href= [mM][aA][iI][lL][tT][oO]: # mailto: ([^\"\s<>]+) # EMAIL \"? # href closed [^<>]* # any attributes > # anchor closed (.+?) # TEXT </[aA]>) # </a> |antispamize($1, $2, $3)|sgex; sub antispamize { my($anchor, $email, $text) = @_; #$email =~ s/@/{at}/g; #$text =~ s/@/{at}/g; my $anchor = "<script language=\"JavaScript\">document.write('" . join("'+'", $anchor =~ /(.{1,4})/g) . "');</script>"; ## may be you want to add this #$anchor .= "<noscript>$text ($email)</noscript>"; return $anchor; }
|
---|
Replies are listed 'Best First'. | |
---|---|
•Re: Hiding mail addresses in mailto: with JavaScript
by merlyn (Sage) on Oct 25, 2003 at 12:47 UTC | |
by tilly (Archbishop) on Oct 25, 2003 at 14:15 UTC | |
by merlyn (Sage) on Oct 25, 2003 at 14:22 UTC | |
Re: Hiding mail addresses in mailto: with JavaScript
by diotalevi (Canon) on Oct 24, 2003 at 17:37 UTC | |
by projekt21 (Friar) on Oct 24, 2003 at 19:12 UTC | |
Re: Hiding mail addresses in mailto: with JavaScript
by Chady (Priest) on Oct 24, 2003 at 18:47 UTC | |
by projekt21 (Friar) on Oct 24, 2003 at 19:24 UTC | |
by talexb (Chancellor) on Oct 25, 2003 at 01:46 UTC |