addResponseListener()

Adds a response listener for all Blox on the page.

Syntax

JavaScriptâ„¢ Method

addResponseListener(responseListener);

where:

Argument Description
responseListener The name of a JavaScript function.

Usage

This method lets you add a JavaScript function which will be notified whenever a DHTML client-RPC returns a success response. This can be used to coordinate actions across frames or other post-event processing. The JavaScript function gets both the request and the response

Examples

The following example demonstrates how the request and response are captured:

<%@ taglib uri='bloxtld' prefix='blox'%>

<html>
<head>
<blox:header />
<script>
  function responseListener( request, response ) {
    var text = "REQUEST:\r\n\r\n" + request.getRequest() + "\r\n\r\n-----
\r\n\r\n";
    text += "RESPONSE: \r\n\r\n" + response.getResponse();
    responseOutput.value = text;
  }
  bloxAPI.addResponseListener( responseListener );
</script>
</head>
...
<body>
<blox:present id="present"
   ...>
</blox:present>
...
<textarea id=responseOutput rows=100 cols=200>
...
</body>
</html>