empty alert box on too quick reload

When the user reloads the scheduler too quickly, she’ll get a empty alert box, as seen in the attached file.

In Firefox this alert box is visible only very quickly before the browser reloads the page. In Chromium however the result is the above mentioned empty alert box, that is modal and blocks the browser until “OK” is pressed.

I’m not sure whether one can detect a reload/abort of a XHTTP call. In case such a status would be available then I’d suggest not to pop up any alert box at all.

The code line in question that displays the pop up is dhtmlx/connector.js:136 of the scheduler code:

dhtmlxError.catchError("LoadXML",function(a,b,c){
        alert(c[0].responseText);
});


In Chromium, when the AJAX call fails, the ‘status’ property of the XHttpRequest object is zero.

Thus, I’d sugest a solution along the following basic idea (dhtmlx/connector.js:136):

dhtmlxError.catchError("LoadXML",function(a,b,c){
        if (c[0].status == 0) {
          // AJAX call was interrupted by a reload:
          // ignore this error and let the browser
          // proceed with reloading.
        } 
        else alert(c[0].responseText);
});

So, if we think we’ve detected a reload (status is set to zero), the we just ignore the error and let the browser reload.

Hello,

Thank you for your feedback and suggestion, we appreciate it :slight_smile:

Kind regards,
Ilya

Some more bits: Chrome seems to work the same as Chromium wrt to what has been told here.