Have you used a debugging tool to figure out what "this" is?  Also,
your function isn't returning "this", possibly an unrelated problem
but it probably should be fixed.


On Sun, Sep 13, 2009 at 1:24 PM, shapper <mdmo...@gmail.com> wrote:
>
> Hello,
>
> I am using JQuery 1.3.2 and I get the error "this.each is not a
> function" when I try to use the following plugin:
>
> jQuery.fn.defuscate = function(settings) {
>    settings = jQuery.extend({
>        link: true
>    }, settings);
>    var regex = /\b([A-Z0-9._%-]+)\([^)]+\)((?:[A-Z0-9-]+\.)+[A-Z]
> {2,6})\b/gi;
>    return this.each(function() {
>        if ($(this).is('a...@href]')) {
>            // If it's an <a> element, defuscate the href attribute
>            $(this).attr('href', $(this).attr('href').replace(regex,
> '$...@$2'));
>            // Make sure that the element's contents is not made into
> a link
>            var is_link = true;
>            //alert($(this).attr('href'));
>        }
>        // Defuscate the element's contents
>        $(this).html($(this).html().replace(regex, (settings.link && !
> is_link ? '<a href="mailto:$...@$2";>$...@$2</a>' : '$...@$2')));
>    });
> }
>
> Could someone, please, tell me what is wrong?
>
> Thanks,
> Migueç



-- 
Turtle, turtle, on the ground,
Pink and shiny, turn around.

Reply via email to