Make a callback with data asynchronously
The next example makes a callback to the server with two numbers (49583 and 83924).
The server-side method waits 5 seconds and then returns the sum of the numbers.
The syntax is:
ob_post.AddParam("number1", 49583);
ob_post.AddParam("number2", 83924);
ob_post.post(null, "myServerMethod", myFunction);
You can still work on the page while waiting for a response from the server. Click to test:
In the next div, a dot is added every 0.5 seconds.
You will see this doesn't stops after you make the callback.
You may also check the synchronous example to see the difference.
| |