Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7498515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:30:09+00:00 2026-05-29T19:30:09+00:00

I want to send array into eq function as parameter. Like that: $(this).find(‘tr’).not(‘:eq(array)’).each(function(){ });

  • 0

I want to send array into eq function as parameter. Like that:

$(this).find('tr').not(':eq(array)').each(function(){

});

I did this with using a loop and eval function but it doesn’t look easy editable. This is my code.

$.fn.grilestir = function(options){

var nots = '';

for(var i=0;i<options.row_numbers.length;i++){
    nots += "not(':eq("+options.row_numbers[i]+")').";
}

    eval("$(this).find('tr')."+nots+"each(function(){\
        var tr = $(this); var orj;\
        if(options.mod == 'passive-rows'){\
            $(this).mouseover(function(){\
                orj = tr.css('backgroundColor');\
                tr.css('backgroundColor', '#777777');\
            });\
            $(this).mouseout(function(){\
                tr.css('backgroundColor', orj); \
            });\
        }\
    });");

}

Is there any way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:30:10+00:00Added an answer on May 29, 2026 at 7:30 pm

    I am assuming that your array contains a set of numbers that represent element indexes. The eq selector will not work with that.

    You could use filter to reduce the matched set of elements to those at indexes within your array:

    var arr = [1, 2];
    $("someSelector").filter(function(index) {
        return arr.indexOf(index) > -1;
    });
    

    Here’s a working example.

    Note the use of Array.prototype.indexOf, which is not available in older browsers (notable IE < version 9). However, there are plenty of shims available to solve that problem. Or, as noted in the comments (thanks @mcgrailm), you could use jQuery.inArray:

    var arr = [1, 2];
    $("someSelector").filter(function(index) {
        return $.inArray(index, arr) > -1;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an multi-dimensional array that I want to send to a PHP script
I have an object in Javascript that looks like this function MyObject(){ this.name=; this.id=0;
I tried to send an array as part of an ajax request like this:
I'm running into some problems with user-entered input that I want to send to
I want to send an array constructed in javascript with the selected values of
i want to send a byte array on udp through an ansi c program
I want so send every week an update by email. But Im afraid that
I have an iPhone app with an array of objects that I want to
I want to send a list of values into a fragment shader. It is
I want to send a byte array from a web service to a client

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.