PHP Classes
elePHPant
Icontem

MultiAjax: Using AJAX in batch mode

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2010-11-07 (4 years ago) RSS 2.0 feedNot enough user ratingsTotal: 1,570 All time: 2,363 This week: 1,031Up
Version License PHP version Categories  
multiajax 1.01GNU Lesser Genera...5.0PHP 5, AJAX
Description Author  

MultiAjax class provides a convenient way to smart work with AJAX. It supports timeout, queue, session limits and batch mode.

The class supports:

- 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.

Picture of Vadym Timofeyev
Name: Vadym Timofeyev <contact>
Classes: 3 packages by
Country: The Netherlands The Netherlands
Age: 40
All time rank: 82324 in The Netherlands The Netherlands
Week rank: 1577 Down44 in The Netherlands The Netherlands Down
Innovation award
Innovation award
Nominee: 1x

Details provided by the author  
README (MultiAjax class)
=========================================

NAME: MultiAjax class library

VERSION: 1.01

AUTHOR: Vadym Timofeyev <tvad@mail333.com> http://weblancer.net/users/tvv/

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>

COPYRIGHT:

    Copyright (c) 2007 Vadym Timofeyev. All rights reserved.
    This software is released under the GNU Lesser General Public License.
    Please read the disclaimer at the top of the MultiCurl.class.php file.
  Files folder image Files  
File Role Description
Plain text file MultiAjax.class.php Class MultiAjax class
Accessible without login Plain text file MultiAjax.js Data MultiAjax JavaScript
Accessible without login Plain text file example.php Example Example
Accessible without login Plain text file README Doc. README
Accessible without login Plain text file ChangeLog Data ChangeLog
Accessible without login Plain text file LICENSE Lic. LICENSE

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,570All time:2,363
 This week:0This week:1,031Up