Ajax Longterm request hanging

244
July 06, 2017, at 03:05 AM

i call 2 PHP scripts, first ist a long term script he creates multiple images, and writes his summary into a Mysql DB the Second php file is DB Reader, catches the outgoings with setInterval

both scrips are testet and operate

my problem is, when i start the js-script i see the interval calls every second , but he becomes all server reply after the longterm script ist finishd.

function json_return($data,$adress,onoff,destination){
    var dbcheck = new XMLHttpRequest();  
    dbcheck.onreadystatechange = function () {
    if (dbcheck.readyState == 4 && dbcheck.status == 200) {
        destination(JSON.parse(dbcheck.responseText));
        }
    }
    dbcheck.open('post', $adress, onoff);
    dbcheck.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    dbcheck.send($data);
}
function test_img(){
    //create Destination DivĀ“s
    json_return('aufbau=1','imgcheck.php',true,img_aufbau);
    //longterm script
    json_return('no','write_graf.php',true,img); 
    imginstance = setInterval(imginterval,1000);    
}
function imginterval(){
    var data = json_return('','imgcheck.php',true,img);
}
Rent Charter Buses Company
READ ALSO
Multiple result display MongoDB Node.JS

Multiple result display MongoDB Node.JS

I was writing code for crypto currency rates display backend,

307
(Android) implement swipe on a collection of items

(Android) implement swipe on a collection of items

I need your help to implement swiping through a collection of items in an Android personnal project (an inventory list)I've seen tons of examples already but I can't seem to implement it correctly

327
What type of backend would I need?

What type of backend would I need?

I don't have any back-end experience, and I'm looking to make a hotel deals appwhat would be a good way of making a remote database with push notifications? I looked into Firebase, but it might be too much since I don't really need my DB to be client-side...

208
Limiting the size of content read by get() in Python requests

Limiting the size of content read by get() in Python requests

I have set up a HTTP nodejs server on my machine locally that displays ever-growing data in JSON formatExample:

315