NAME
    AJAX - A simple crossbrowser javascript interface to the AJAX technology

SYNOPSIS
      // Create a new AJAX object
      var oAJAX = new AJAX();

      // Make a call
      oAJAX.call(
          {
              uri: 'http://host.domain.tld/cgi-bin/ajax_script',
              callback: manageResponse
          },
          { param1: 'value1', param2: 'value2' }
      );

      // Manage the response
      function manageResponse( cResponse )
      {
          var oDiv = document.getElementById('myDiv');
          oDiv.innerHtml = cResponse;
      }

DESCRIPTION
    This fabulous class implements an OO approach to the AJAX technology,
    providing methods for make asynchronous calls to a CGI from a web page
    via JavaScript and the XMLHttpRequest object.

METHODS
  new()
    Object constructor, returns a brand new AJAX object.

    No parameters are requested here, so you can make multiple different
    calls on the same object by passing different parameters to che call()
    method.

  call()
    This public method performs the call via XMLHttpRequest to the specified
    server's script and returns the response.

   Parameters
    oProps
       Structure with properties used in the call passed as an object
       literal.

       Properties are:

       "uri"          URI of the script to call; mandatory!

                      Ex.: http://host.domain.tld/cgi-bin/ajax_script

       "method"       HTTP method to use in the call.

                      GET, POST, HEAD... (default is GET)

       "asyncronous"  indicates if the function execution will continue
                      while waiting the server response or not.

                      true or false (default is true)

       "responsetype" indicates which method use for retrieve the response.

                      text or xml (default is text)

       "callback"     reference to the function to use for process the
                      response.

    rParams
       List of parameters to pass to the call; optional.

       You can pass an URL-escaped string, an object literal, an array or an
       array literal.

   Returned value
    cResponse
        Response stuff depending on responsetype setting.

        Can be plain text or XML.

  _getHandle()
    This private method is called by the call() method and returns the
    XMLHttpRequest object.

EXPORTS
    When used with "JSAN" will export "call".

EXAMPLES
      // Call without parameters:
      oAJAX.call(
          {
              uri: 'http://host.domain.tld/cgi-bin/ajax_script',
              callback: function( cText ) { alert( cText ); }
          }
      );

      // Call with parameters as object literal and XML response:
      oAJAX.call(
          {
              uri: 'http://host.domain.tld/cgi-bin/ajax_script',
              responsetype: 'xml',
              callback: function( cXml ) { alert( cXml ); }
          },
          { mode: 'xml', param1: 'value1' }
      );

      // Call with parameters as array literal and XML response:
      oAJAX.call(
          {
              uri: 'http://host.domain.tld/cgi-bin/ajax_script',
              responsetype: 'xml',
              callback: function( cXml ) { alert( cXml ); }
          },
          [ 'mode','xml','param1','value1' ]
      );

      // Call with parameters as standard array with POST method
      oAJAX.call(
          {
              method: 'POST',
              uri: 'http://host.domain.tld/cgi-bin/ajax_script',
              callback: function( cResponse ) { alert( cResponse ); }
          },
          new Array( 'param1', 'value1' )
      );

      // Call with parameters as string
      oAJAX.call(
          {
              uri: 'http://host.domain.tld/cgi-bin/ajax_script',
              callback: function( cText ) { alert( cText ); }
          },
          'param1=value1&param2=value2'
      );

SEE ALSO
    Official web page at
    <http://www.sabadelli.it/edoardo/projects/javascript/ajax>

AUTHOR
    Edoardo Sabadelli - <http://www.sabadelli.it/edoardo>

COPYRIGHT
    Copyright (c) 2006-2007 Edoardo Sabadelli. All rights reserved.

    This module is free software; you can redistribute it and/or modify it
    under the terms of the Artistic license.

