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 6658251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:53:34+00:00 2026-05-26T01:53:34+00:00

I am getting the error Uncaught RangeError: Maximum call stack size exceeded on chrome.

  • 0

I am getting the error “Uncaught RangeError: Maximum call stack size exceeded” on chrome. here is my jQuery function

$('td').click(function () {
        if ($(this).context.id != null && $(this).context.id != '') {
            foo($('#docId').val(), $(this).attr('id'));
        }
        return false;
    });

Note that there are tens of thousands of cells in the page. However, I generally associate stack overflows with recursion and in this case as far as I can see there is none.

Does creating a lambda like this automatically generate a load of stuff on the stack? is there any way round it?

At the moment the only workaround I have is to generate the onclick events explicitly on each cell when rendering the HTML, which makes the HTML much larger.

  • 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-26T01:53:34+00:00Added an answer on May 26, 2026 at 1:53 am

    As “there are tens of thousands of cells in the page” binding the click-event to every single cell will cause a terrible performance problem. There’s a better way to do this, that is binding a click event to the body & then finding out if the cell element was the target of the click. Like this:

    $('body').click(function(e){
           var Elem = e.target;
           if (Elem.nodeName=='td'){
               //.... your business goes here....
               // remember to replace $(this) with $(Elem)
           }
    })
    

    This method will not only do your task with native “td” tag but also with later appended “td”. I think you’ll be interested in this article about event binding & delegate


    Or you can simply use the “.on()” method of jQuery with the same effect:

    $('body').on('click', 'td', function(){
            ...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this error: Uncaught Error: NOT_FOUND_ERR: DOM Exception 8 Here is my
I am getting this error Uncaught ReferenceError: loadNext is not defined (anonymous function) The
Why am I getting this error: Uncaught SyntaxError: Unexpected token < c.b.extend.globalEval jquery-1.4.4.min.js:32 c.extend.httpData
I keep getting this error: Error: uncaught exception: Syntax error, unrecognized expression: [object Object]
I'm getting this error: Uncaught handler: thread main exiting due to uncaught exception java.lang.VerifyError
For some reason, I'm getting this error message: Uncaught TypeError: Object #<an Object> has
For some reason, I'm getting this error message: Uncaught SyntaxError: Unexpected token < For
guys i'm getting this error Fatal error: Uncaught OAuthException: Error validating access token. thrown
I'm getting the error Uncaught TypeError: Function.prototype.apply: Arguments list has wrong type when I
I don't know why getting this error: Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 From

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.