|
November 21, 2001 Handling the event.result Object Tips: November 2001
Yehuda Shiran, Ph.D.
|
|
One of the two ways to call a Web service in Internet Explorer is without a callback handler. Here is an example that calls the add method with two arguments, intA and intB:
In this case, you need to specify the onresult event handler:
The event handler onWSresult() first checks to see if there was an error during the Web service call:
Notice that the result object is a property of the event object. The event handler also checks that the event ID, as it came from the Web service, is identical to the ID returned by the callService() funtion:
With these two checks you can write an event handler that processes the result object, checks for errors and matching IDs, and prints the result value. Here is a Microsoft example:
People who read this tip also read these tips: Look for similar tips by subject: |