This is ajax.egg.info, produced by makeinfo version 4.7 from eggdoc-output.texi. INFO-DIR-SECTION The Algorithmic Language Scheme START-INFO-DIR-ENTRY * ajax.egg: (ajax.egg). A basic interface to AJAX, using the Prototype javascript library (included). END-INFO-DIR-ENTRY  File: ajax.egg.info, Node: Top, Next: About this egg, Up: (dir) ajax egg ******** A basic interface to AJAX (http://en.wikipedia.org/wiki/Ajax_%28programming%29), using the Prototype (http://prototype.conio.net/) javascript library (included). Written by felix (mailto:felix@call-with-current-continuation.org) This manual corresponds to version 1.6 of the ajax extension library for Chicken Scheme. * Menu: * About this egg:: * Documentation:: * Examples:: * License:: * Index::  File: ajax.egg.info, Node: About this egg, Next: Documentation, Prev: Top, Up: Top 1 About this egg **************** * Menu: * Version history:: * Requirements:: * Usage::  File: ajax.egg.info, Node: Version history, Next: Requirements, Up: About this egg 1.1 Version history =================== `1.6' Added key parameter to `ajax' `1.5' Removed quoting from `remote-action' argument parameter `1.4' Updated prototype.js to version 1.4.0 `1.3' Fixed bug in handling of 'parameters' keyword arg `1.2' Several enhancements by Daishi Kato `1.1' Bugfix in `remote-button' by Daishi Kato; `current-request' and `current-urlencoded-arguments' are now also available in callbacks `1.0' Initial release  File: ajax.egg.info, Node: Requirements, Next: Usage, Prev: Version history, Up: About this egg 1.2 Requirements ================ This egg requires the following extensions: `md5', `spiffy', `url'  File: ajax.egg.info, Node: Usage, Prev: Requirements, Up: About this egg 1.3 Usage ========= Load this egg like so: `(require-extension ajax)'  File: ajax.egg.info, Node: Documentation, Next: Examples, Prev: About this egg, Up: Top 2 Documentation *************** This extension provides a set of procedures to use asynchronous callbacks from a browser to a Chicken-powered web-server (for example Spiffy (http://www.call-with-current-continuation.org/eggs/spiffy.html)). This is done using Prototype's wrappers around the `xmlHttpRequest' API. -- parameter: ajax-output-format (ajax-output-format [SYMBOL]) Specifies how HTML and script-fragments generated by the procedures of this package should be handled. `SYMBOL' should be either `shtml' or `html', where the former requests output as SXML expressions and the latter as text containing HTML. `html' is the default. -- parameter: ajax-callback-registration (ajax-callback-registration [PROCEDURE]) Holds a procedure that will be called for every registered `xmlHttpRequest' callback (see below). -- procedure: ajax (ajax [KEY [SCRIPTFILENAME]]) Initializes callback handling for this page/response and returns a HTML or SHTML fragment containing a script element linking to the given source filename, which defaults to `prototype.js'. The Prototype library is included in the distribution and will be installed in the extension repository. The optional argument KEY is used to make the generated callback-URLs for this page more unique and may be an arbitrary string. This procedure resets the callback-handling for this response and must be called before using any of the `remote-...' procedures described below. -- procedure: remote-url (remote-url THUNK [ARGUMENTS]) Registers a HTTP callback handler for a generated URL that invokes THUNK, a procedure with no arguments. If ARGUMENTS is given, then it should be a string or an association-list mapping URL-encoded argument-names to values. In both cases the arguments will be encoded in the url, or the body of the request, depending on the request method. This procedure returns an URL as a string. -- procedure: remote-action (remote-action THUNK #!key arguments update insert-before insert-after insert-top insert-bottom method success failure name frequency eval-scripts) Returns a string containing Javascript code to invoke the zero-argument procedure THUNK via an `xmlHttpRequest' callback. Depending on the keyword arguments the result returned from THUNK is treated as HTML or SHTML and describes a HTML fragment that should be used to modify the current document. The meaning of the various keyword arguments is as follows. `arguments' A string or an association list of URL-encoded variable/value pairs (see `remote-url' for more information) `update' the id of a document node that should be replaced with the SXML of this reply `insert-before' Document-id of element before which the reply will be inserted `insert-after' Document-id of element before which the reply will be inserted `insert-top' Document-id of element in which the reply will be inserted as the topmost sub-element `insert-bottom' Document-id of element in which the reply will be inserted as the bottommost sub-element `method' HTTP request method used `success' Javascript code to be evaluated on successful reply `failure' Javascript code to be evaluated on non-succesful reply `name' The name of a Javascript variable which should be assigned to the created Prototype placeholder object `frequency' The interval in seconds after which the callback should be invoked `eval-scripts' If true, evaluate JavaScript code received in the response Note that the `update', `insert-...', `success' and `failure' arguments are mutually exclusive. If the `frequency' argument is given, a periodical timer will be started (you can use the `name' argument to obtain a reference to the timer and call the `start' and `stop' Javascript methods to control it). -- procedure: remote-link (remote-link TEXT THUNK KEYWORD-ARGUMENTS ...) Returns HTML or SHTML for a link (`') that will invoke THUNK when clicked. The KEYWORD-ARGUMENTS are the same as for `remote-action'. -- procedure: remote-button (remote-button TEXT THUNK KEYWORD-ARGUMENTS ...) Returns HTML or SHTML for a button (`