Changeset 6550


Ignore:
Timestamp:
Oct 2, 2014, 12:57:13 PM (8 years ago)
Author:
Nicklas Nordborg
Message:

References #1852: Use AJAX to update footnote instead of page reloading

Also hande the case when the AJAX call to check for messages fails.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-stable/www/footnote.js

    r6544 r6550  
    5050    var request = Ajax.getXmlHttpRequest();
    5151    request.open("GET", url, true);
    52     Ajax.setReadyStateHandler(request, footnote.messagesLoaded);
     52    Ajax.setReadyStateHandler(request, footnote.messagesLoaded, footnote.messagesNotLoaded);
    5353    request.send(null);
    5454  }
     
    8484      Doc.show('credit');
    8585    }
    86    
    8786    setTimeout(footnote.loadMessages, pAutoReload * 1000);
    8887  }
    8988
     89  footnote.messagesNotLoaded = function(request)
     90  {
     91    App.debug('Footnote not updated: ' + request.responseText);
     92    setTimeout(footnote.loadMessages, pAutoReload * 1000);
     93  }
    9094 
    9195  /**
Note: See TracChangeset for help on using the changeset viewer.