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

  • SEARCH
  • Home
  • 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 8472459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:04:49+00:00 2026-06-10T17:04:49+00:00

I am trying to implement a real-time search filtering function and am using $.each()

  • 0

I am trying to implement a real-time search filtering function and am using $.each() in jQuery. Right now I’m just trying to loop through each element and print its text but am running into a maximum call stack exceeded issue. The list is about 50-60 items so I’m thinking size isn’t an issue at all and perhaps I’m running into some infinite recursion although I don’t think so. Below is my relevant HTML:

<div id="brands">
    <ul id="left_brands">
        <li><a class="brand_check" href="javascript:void">Vineyard Vines</a></li>
        <li><a class="brand_check" href="javascript:void">Brooks Brothers</a></li>
        <li><a class="brand_check" href="javascript:void">Coast Apparel</a></li>
        <!-- etc. -->
    </ul>
</div>

And here is the jQuery code that’s giving me the error:

$("#brand_filter input").keyup(function() {
    $.each("#brands li a", function() {
        alert($(this).text());
    });
});

Any suggestions are much appreciated.

  • 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-06-10T17:04:51+00:00Added an answer on June 10, 2026 at 5:04 pm

    Do this instead:

    $("#brand_filter input").keyup(function() {
        $("#brands li a").each(function() {
            alert($(this).text());
        });
    });
    

    The recursion is occurring inside Sizzle’s getText–you’re iterating over the string characters themselves, not selector results. In this case I don’t see any benefit to doing it the way you thought you were, and and this seems more canonical (could just be my preference, however).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a real-time updating search bar which updates a TreeView when
I am trying to implement a real-time application which involves IPC across different modules.
I'm trying to run real time java code using the Websphere Realtime Java VM
I'm trying to implement a Real-Time Strategy control scheme for the MS Kinect. So
I'm trying to implement a chart that can handle real time data, which comes
Trying to implement a search similar to here .This searches properties based on city,locality,property
Trying to implement 3-layer (not: tier, I just want to separate my project logically,
I'm trying to display a UIImage in real-time coming from the camera, and it
I'm trying to implement drag and drop in Silverlight using F# and asynchronous workflows.
I'm trying to simulate a real-time network where nodes are consumers and producers of

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.