SimileAjax/Ajax

= SimileAjax AJAX =

There is no SimileAjax.AJAX namespace; instead, a custom event listener queue class ListenerQueue is defined.

Code: http://api.simile-widgets.org/ajax/2.2.1/scripts/ajax.js

Migration Notes
jQuery has its own custom event handling, this may not be necessary.

Back to SimileAjax.

implicit Listener class
To be acceptable as a listener item in a ListenerQueue instance, the listener must provide functions matched to keys that are the names of handlers known to be available to the ListenerQueue.

SimileAjax.ListenerQueue

 * Arguments:
 * wildcardHandlerName: string (optional), A handler name that matches every handler
 * Description: Holds a queue of listeners that respond to handlers in the order they're added

SimileAjax.ListenerQueue.prototype.add

 * Arguments: listener
 * Returns: Nothing
 * Description: Adds a listener to the queue

SimileAjax.ListenerQueue.prototype.remove

 * Arguments: listener
 * Returns: Nothing
 * Description: Removes a listener from the queue

SimileAjax.ListenerQueue.prototype.fire

 * Arguments:
 * handlerName: string, The handler name
 * args: Array, the arguments to pass on to the handler
 * Returns: Nothing
 * Description: Runs the function of any listener that either provides one for the handler name or, if not, has a wildcard match. The wildcard match does not also run if the handler is matched.

Back to SimileAjax.