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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:17:10+00:00 2026-06-09T17:17:10+00:00

So basically I wan’t to get data from server at start and then update

  • 0

So basically I wan’t to get data from server at start and then update it every 2 minutes, but instead it gets first value only after 2 minutes, what can I do about this?

Here is my js markup:

var itemViewModel = {
    item: ko.observable().extend({ throttle: 120000 }),
    loadcontent: function (getID) {
        $.ajax({
            url: '/api/item/details/' + getID,
            dataType: 'json',
            success: function (data) {
                itemViewModel.item(data);
            }
        });
    }
};

Maybe this will help, here is a HTML markup:

<div id="item-details-content">
    <input type="hidden" id="item-id" value="@id" data-bind=""/>
    <div class="item-list" data-bind="init: itemPage.loadcontent(@id), with: itemPage.item">

Conditions

  1. There need to be and initial call of loadcontent
  2. Everything must be inside viewModel
  • 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-09T17:17:11+00:00Added an answer on June 9, 2026 at 5:17 pm

    That’s not what the throttle extender (link) is meant for. Use setInterval (link) instead.

    throttle is meant to handle a scenario where you may receive an arbitrary amount of events in a short timespan and you do not want to act upon every single event. E.g. you have a search field with autocomplete functionality that uses a REST-API. You do not want to call the REST-API every single time a user pushes a key. Rather, you’d like to wait a bit until the user is done typing. This is a perfect use case for throttle.

    What you are looking for is a way to repeat an action on a predetermined interval. JavaScript has a builtin function just for that and it’s called setInterval.

    var itemViewModel = {
        item: ko.observable().extend({ throttle: 120000 }),
        loadcontent: function (getID) {
            var loadData = function()
            {
                $.ajax({
                    url: '/api/item/details/' + getID,
                    dataType: 'json',
                    success: function (data) {
                        itemViewModel.item(data);
                    }
                });
            }
            loadData(); // initial call
            setInterval(loadData, 120000); // repeat every 2 minutes
        }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically from a database I am getting data that is formatted like this nameofproject101
Basically I wan't to obtain a string from the user, I have created a
Basically I need to get older version of a file in the repository without
Basically from C++ FAQ I learned that: A virtual function allows derived classes to
Basically I have a large set of data in excel, and I was wondering
Basically, I get the error: -[UIViewController donePress:]: unrecognized selector sent to instance 0x6a7f7c0 ***
I want to create string ENUM in c#. Basically i wan't to set form
I am trying to write a ruby app to update Google Contact Photos but
Basically, what I need to do is update a record in my datatable without
I have service that I need to run every 5 minutes. I already have

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.