خرید بک لینک

Vote count: 0

I need to call the .each() function on multiple jQuery objects like this:

$('#table_1').each(function(){ /* foo */ });
$('#table_2').each(function(){ /* foo */ });
$('#table_3').each(function(){ /* foo */ });

I have not found a better way of doing this than writing out each function individually.

Defining a function like this:

$.fn.extend({
    foo: function() {

        //Some code
    }
});

$('#table_1').each(foo);

retus a "caot read property 'call' on undefined function" error in the console.

What am I doing wrong here?

asked 31 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 5 مرداد 1395 ساعت: 15:51

صفحه بندی