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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:40:51+00:00 2026-05-22T00:40:51+00:00

Just curious, I have this function: setInterval( function(){ sendAjax(‘search’, eInput, function(responseText){ $(#txtResp).html(responseText); }) },

  • 0

Just curious, I have this function:

setInterval( function(){
       sendAjax('search', eInput, function(responseText){
              $("#txtResp").html(responseText);
       })
}, 5000 );

It runs this function continuously, with no interval. It causes my sendAjax function to run like crazy.

I just need it to run every 5 seconds. Any help?

Regards,

Taylor

  • 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-22T00:40:51+00:00Added an answer on May 22, 2026 at 12:40 am

    Doubt this is the problem, but don’t forget to end your lines with a semicolon

    setInterval( function(){
             sendAjax('search', eInput, function(responseText){
                    $("#txtResp").html(responseText);
             }); // <---
     }, 5000 );
    

    Also it could be a problem that just because you’re doing something every 5 seconds, the callback to sendAjax will be executed when a response is received regardless of the interval. So you may be seeing consecutive responses repeatedly writing to the #txtResp div

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

Sidebar

Related Questions

Just curious, I have this function: function detectChanges() { sendAjax('reload', num_rows, '', function(data) {
Just curious what is the best practice for solving the following issue. I have
I have been a .net developer for the past three yrs. Just curious to
Just curious. How does actually the function Sleep() work (declared in windows.h)? Maybe not
Just curious how you would comment this line of code: string customerNm = customerNm.EndsWith(s)
I was just curious if I could pass a function as a variable. For
This is an example, I'm just curious as to how it would be achieved.
So I have a function that looks something like this: float function(){ float x
So if I have a function like this in c# (#1) private void Test(){
I'm just curious to see what you guys think about this. I heard a

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.