README (MultiAjax class)
=========================================
NAME: MultiAjax class library
VERSION: 1.01
DESCRIPTION:
MultiAjax class provides a convenient way to smart work with AJAX.
It supports timeout, queue, session limits and batch mode.
Supported features:
- Autoselect GET or POST method for HTTP request.
- Timeouts. It is possible to setup different timeouts for AJAX requests.
- Work with queue of requests and limit parallel queries.
Example: setup queue for maximum 100 requests with 5 parallel sessions.
- Batch mode. Multiple AJAX requests can be pack into batch structure and
post as only one HTTP request.
- Work with different encodings, including UTF-8.
- Use own fast serialization mechanism.
SYNOPSIS:
<?php
include_once 'MultiAjax.class.php';
class ExampleMultiAjax extends MultiAjax {
public function example_echo($data) {
return $data;
}
}
$ma = new ExampleMultiAjax();
if ($result = $ma->dispatch()) {
die($result);
}
?>
<html>
<head>
<title>MultiAJAX DEMO</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script type="text/javascript" src="/MultiAjax.js"></script>
</head>
<script>
function test_send() {
multiajax.send({
url: '/examples/example.php',
handler: 'example_echo',
data: document.forms[0].ti.value,
callback: function(result) {
document.forms[0].ta.value += (result.error ? result.error : result.data) + '\n'
}
})
}
</script>
<body>
<form>
<textarea name="ta" rows="20" style="width:700px"></textarea>
<br><br>
<input name="ti" style="width:650px;">
<input type="button" onclick="test_send()" value="Test" style="width:45px">
</form>
</body>
</html>
|