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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:22:23+00:00 2026-05-25T11:22:23+00:00

I’ve created a character counter for use in the JQuery library to have a

  • 0

I’ve created a character counter for use in the JQuery library to have a similar effect as the Twitter counter (remaining characters left counter). However, I’ve noticed that at least FireFox has a rough time handling it (other browsers show some strain, but not as bad). Basically, while typing at a steady pace, it’ll begin to play ‘catch up’ and even make the browser unresponsive until it does catch up. When trying the same typing speed in Twitter’s textbox, it has no slow down at all!

While I do have an autoresize plugin that watches this box, I’ve tried many removal and changes to find that only this code is causing the slow down. So, while I can assume it might be too much math for the browser to handle at a certain time, I don’t really see why there’s a problem with how simple this is, nor can think of a solution.

/* Post Saying text count */
var postSayingLimit = 450;
$('span.counter').text(postSayingLimit);
$('#post-saying').bind('keyup keypress', function() {
    var postSayingUsed = $(this).val().length;
    if(postSayingUsed >= postSayingLimit - postSayingLimit / 10) {
    $(this).parent().find('span.counter').addClass('counter-limit');
    } else {
    $(this).parent().find('span.counter').removeClass('counter-limit');
    }
    var postSayingCount = postSayingLimit - postSayingUsed;
    $(this).parent().find('span.counter').text(postSayingCount);
});

I’ve tried removing the conditional, going to one binding, and even inserting hard values with it only to continue it’s lag. Maybe moving some of the variables out of the bind function? Making the actual counter process into a function as well?

  • 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-25T11:22:24+00:00Added an answer on May 25, 2026 at 11:22 am

    I made an example here: http://jsfiddle.net/zpjc6/

    works fast for me (chrome though). i also made a minor improvement by saving the span in an variable. While it’s good practice to do so it shouldn’t be that expensive though.
    But maybe it helps.

    edit: maybe you could link to your actual site?

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a text area in my form which accepts all possible characters from
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to understand how to use SyndicationItem to display feed which is
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I am reading a book about Javascript and jQuery and using one of the

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.