An Ajax API - Manual

Attributes and functions of the Anaa framework.

(c) 2007 - Sandrine Takis & Denis Sureau

 

Anaa is an Ajax framework. It is released under the Mozilla 1.1 licence.

 

Attributes

AACaching

AACaching: Boolean

The attribute is set to true if caching is allowed or false if it is not allowed.
You should leave it off, but for files that are rarely modified. Disabling caching reduces performances on big files, but enabling it produces bad results.

 

Functions

AACreate

This method is called by other methods to create an XMLHttpRequest object.

Interface:

function AACreate()

Argument: none.
Return: An XMLHttpRequest object.


AARead

Called to read a document.
The type of the document is determinated by the extension. Any extension that ends by "ml" (xml, xhtml, etc...) should be XML compatible. Other extensions are supposed to be plain text files.
A JSON file should have a json or js extension and is a text file.

Interface:

function AARead(url, callback, element)

Arguments:

Return: nothing.

 

AALoadXML

Load an XML file with any extension.

Interface:

function AALoadXML(url, callback, element)

Arguments

Return: nothing.

 

AALoadHTML

Loads the content of a HTML page into a variable or a tag in the currently displayed page. This allows to access the data of the other page by the methods of the Document Object Model.
Before to call the function, you have to declare a variable or create a tag to store the content.
The function calls a user-defined function passed as argument, that processes the body of the HTML page loaded.
The param argument may be the id of a div where to store the extracted data.
Look at the demos for details about the use of this function.

Interface:

function AALoadHTML(url, callback, storage-id, param)

Arguments:

return:

 

AAWrite

Called to pass data to a script.

Interface:

function AAWrite(url, data)

Arguments:

Return: nothing.

 

AAGetBody

Extract the content of the body tag from a string holding a web page.

Interface:

function AAGetBody(content)

Argument:

Return: A string.

 

Licence

Free, open source under the Mozilla 1.1 licence.
You can use the library freely, extend it if you want, but do not remove the copyright notice.