JavaScript how to call ajax function untill already run ajax not give a response? call ajax function from html,call ajax function on button

I want to call my ajax function untill already run ajax not give a response

Page is load on every sec and every sec ajax function call but i want to call ajax untill already run ajax function is not responde .

can i store ajax function refresh rate so that after this my function load ?

any solution ? please help me.

below are my code which i am using.

function realtime_content() {

var xmlhttp=false;
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
    {
    xmlhttp = new XMLHttpRequest();
    }
if (xmlhttp) 
    {
    RTupdate_query = "RTajax=1&DB=" + DB + "" + groupQS + usergroupQS + "&adastats=" + adastats + "&SIPmonitorLINK=" + SIPmonitorLINK + "&IAXmonitorLINK=" + IAXmonitorLINK + "&usergroup=" + usergroup + "";

    xmlhttp.open('POST', 'demophp'); 
    xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
    xmlhttp.send(RTupdate_query); 
    xmlhttp.onreadystatechange = function() 
        { 
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 
            {
            document.getElementById("realtime_content").innerHTML = xmlhttp.responseText;
            }
        }
    delete xmlhttp;
    }
}

This is page load function

function refresh_display()
{
if ($start_count < 1)
    {
    realtime_content();
    }
$start_count++;
if (ar_seconds > 0)
    {
    document.getElementById("refresh_countdown").innerHTML = "" + ar_seconds + "";
    ar_seconds = (ar_seconds - 1);
    setTimeout("refresh_display()",1000);
    }
else
    {
    document.getElementById("refresh_countdown").innerHTML = "0"
    realtime_content();
    setTimeout("refresh_display()",1000);
    }
}

I added an Image In this image page AST_timeonVDADall_final.php calling many times at page load and going in pending time.

So i want to resolve this pending time, if page is in pending no request go to on this page AST_timeonVDADall_final.php.

when pending resolved then this page AST_timeonVDADall_final.php call again.

enter image description here

Answer:1

I have a problem on how to rearrange my panels on mobile. The panels have different sizes. Pls see attach for the screenshot of the page in large screen (col-lg): EDIT: The large screen layout is ok, ...

I have a problem on how to rearrange my panels on mobile. The panels have different sizes. Pls see attach for the screenshot of the page in large screen (col-lg): EDIT: The large screen layout is ok, ...

I'm writing a NodeJS service that requests data from APIs. Under load, I don't want to hammer the API with potentially hundreds of simultaneous requests, so I am trying to queue up the requests so ...

I'm writing a NodeJS service that requests data from APIs. Under load, I don't want to hammer the API with potentially hundreds of simultaneous requests, so I am trying to queue up the requests so ...

I'm learning electron and I've made an electron app that read and create files. When I start the application with "npm start" or "electron ." it works as intended but when I use the "npm run build" ...

I'm learning electron and I've made an electron app that read and create files. When I start the application with "npm start" or "electron ." it works as intended but when I use the "npm run build" ...

I am new to React. I am trying to display few locations over Google Maps using google-map-react. I am using the below source for it. import React, { Component } from 'react'; import GoogleMapReact ...

I am new to React. I am trying to display few locations over Google Maps using google-map-react. I am using the below source for it. import React, { Component } from 'react'; import GoogleMapReact ...

  1. react array iteration
  2. react array foreach
  3. react array loop
  4. react array foreach render
  5. react array foreach is not a function
  6. react array loop render
  7. react array foreach break
  8. react native array iteration
  9. react js array iteration
  10. react iterate array of objects
  11. react iterate array in render
  12. react iterate array jsx
  13. react iterate array component
  14. react iterate array of strings
  15. react iterate array key
  16. react loop array of objects
  17. react loop array jsx
  18. react loop array map
  19. react loop array of elements