Handling AJAX Timeouts

Comments (0)

AJAX applications can be a great way to deliver rich functionality through the portal, but timeout issues can be frustrating to debug. In particular, clicks in an AJAX application cause HTML to be loaded through the gateway, but if the gateway times out, the portal will return its own HTML in the asynchronous response:

AJAX Timeout

AJAX calls are usually implemented by creating a request and asynchronously writing the response out to the tag. An easy way to prevent the portal error from appearing inside the portlet is to check the returned HTML before writing it out to the div tag; searching for the error string allows you to write out your own error rather than using the portal's.

    var htmlFromAJAXCall = response.getResponse();
    if (htmlFromAJAXCall.substring("Error - ") == -1) {
        document.getElementById("responseDivTag").innerHTML = "A timeout error has occurred; trying again"; 
        // repeat the AJAX request again
    }
    else {
        document.getElementById("responseDivTag").innerHTML = htmlFromAJAXCall;
    }

Leave a comment

Recent Entries

Oh ALBPM, why you gotta go and load images like 'dat?
Howdy all.  Hope the nice weather is finding happy, healthy, and allergy free. As we were doing spring ALBPM house-keeping…
Import Content into Publisher
These are exciting times with Aqualogic (ALI) and its direction as a Portal technology after Oracle's acquisition of BEA Systems. …
PTSpy log messages linked to ... hair loss?
For the past few years, researchers have been perplexed about the causes behind the increased rate of hair loss in ALUI portal administrators.  So, a team…