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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:16:50+00:00 2026-05-23T04:16:50+00:00

I had some help today with a need and this is what I have

  • 0

I had some help today with a need and this is what I have come up with:

      $(window).keypress(function (e)
      {
          if (e.keyCode == 13)
          {
              $('#doCheck')
        .css('color', '#666')
        .delay(100)
        .queue(function (next)
        {
            $(this).css('color', '#00ff00');
            next();
        });

        doCheck('mark1');
      }

<input id='doCheck' type="button" onclick="doCheck('mark1'); return false;" value="Mark" />

The idea here is that when a user presses the ENTER key then the color of the button will change color for 100 milliseconds and at the same time I call a function called doCheck that will call AJAX.

My problem is that there seems to be some minimal delay of almost a second before the color of the button changes back to #666. I expect a much shorter time but even if I set the delay to 10 then it still seems to delay for 1/2 to one second. I should add that if I set a long delay like five seconds then it really does do the five seconds.

I can’t see what’s wrong here.

Does anyone have any ideas?

thanks,

Here is the doCheck function. The function works correctly. Just the button thing is giving me problems. Note that I just changed it to async: true

function doCheck(task)
      {
          var parms = {
              task: task,
              pk: $('#Q_PartitionKey').val(),
              rk: $('#Q_RowKey').val(),
          };
          $.ajax({
              type: "POST",
              traditional: true,
              url: '/power/check',
              async: true,
              data: parms,
              dataType: "json",
              success: function (data)
              {
                  // $('#doCheckMark').attr("disabled", false);
                  // $('#doCheckMark').css("color", "#000");
              },
              error: function ()
              {
                  var cdefg = data;
              }
          });
      }
  • 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-23T04:16:51+00:00Added an answer on May 23, 2026 at 4:16 am

    Is doCheck doing a synchronous call? If so, the queued function won’t get called until your ajax call returns… which might account for the unexpected delay.

    The fix would be to ensure that doCheck’s using a proper asynchronous call.

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

Sidebar

Related Questions

Need some help with this problem in implementing with XSLT, I had already implemented
Updating this Thread as I have had some other help solving why I was
today i need help with some jquery, which I really do not have much
Probably a simple one, but I need some help. I had some radio buttons
( First time programming in PHP. Had some help. Need a bit more. )
I've had some brilliant help before and I'm hoping you can get me out
Just started working on a c project. Need help with passing function pointers/macro functions/etc.
Actually i had been practicing some of the java programs today(trying to learn it
I had some help in the past with getting the coordinates of a network
I've had some help from a friend (who is now away on holiday) but

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.