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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:03:59+00:00 2026-06-08T07:03:59+00:00

I have a web service where I fetched my data and populate it in

  • 0

I have a web service where I fetched my data and populate it in my client. As of now, I have a button that will fetch data from the web service when clicked using ajax get. On my web service, I have a maintenance where I will be able to add, edit or delete data. What I want to do is to have my client automatically fetched data from my web service everytime I add, edit, or delete data, so it will show accurate data to the client.

Here’s what I’m thinking. On my web service, i will have a json that will tell true/false whether the data has been updated (will be fetched by the client). So every add, edit, delete will turn that to true, and every time the client fetched that data, it will become false.

Now, I need to have a javascript/jquery listener that will listen to any change in that json (the true or false). I need to have that listener run every second? Is it possible?

Thanks.

EDITED:

I’ve been rereading my post, and it hits me, I’m just thinking with only one client in my mind. Every add,edit,delete in my web service will turn the “updated” to true, and everytime I get a request for the data, I’ll set it to false. But how about the other clients? When they sent a request, it’s already false, so they will not update it. Any ideas? Thanks

  • 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-08T07:04:01+00:00Added an answer on June 8, 2026 at 7:04 am

    You can do this using two aproaches:

    1. Web sockets; or
    2. setInterval function.

    Here is an example of setInterval().

    // just a control var...
    var gen = 1;
    
    // call the function repeatedly in 5 seconds of interval
    // this call returns an id that can be used to stop the calls
    var id = setInterval(function(){
    
        // function body...
    
        alert( "making an ajax request...(" + gen + ")" ); // here you call your webservice
        gen++;
    
        // just want to stop it, but you wont need this.
        if ( gen == 10 ) {
            clearInterval( id );
        }
    
    }, 5000 ); // 5000 miliseconds == 5 seconds
    

    Some links:

    • jsFiddle: http://jsfiddle.net/davidbuzatto/EyCSb/
    • https://developer.mozilla.org/en/DOM/window.setInterval
    • https://developer.mozilla.org/en/DOM/window.clearInterval
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Android app that fetches data from the web service using ksoap2,
I have written some data fetch service which fetches some entities from main web
I have a app that parses all my data from my web service as
I have web service urls that were working fine and are now returning the
I have web service written that generates some data...can I call the web service
I have a web service that needs to be protected from unauthorized users. I
I have a web-service that I will be deploying to dev, staging and production.
So I've been working on fetching data from a web service and using it
I have string that look like Array that fetched from other webservice like this
I have web service, which use integrated security in IIS. Now, I want to

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.