Changeset e3dab56e


Ignore:
Timestamp:
Mar 27, 2012 8:08:11 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
dc402ac
Parents:
d3578e2
Message:

Delay router down message until two consecutive fails

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/jsp/js/ajax.js

    rd3578e2 re3dab56e  
     1var fails = 0;
     2
    13function ajax(url, target, refresh) {
    24  // native XMLHttpRequest object
     
    2224    // only if "OK"
    2325    if (req.status == 200) {
     26      fails = 0;
    2427      results = req.responseText;
    2528      document.getElementById(target).innerHTML = results;
    2629      //document.getElementsbyClassName("hideifdown").style.display="block";
     30    } else if (fails == 0) {
     31      // avoid spurious message if cancelled by user action
     32      fails++;
    2733    } else {
    2834      document.getElementById(target).innerHTML = failMessage;
Note: See TracChangeset for help on using the changeset viewer.