Attributes and functions of the Anaa framework.
© 2007-2012 - Sandrine Takis & Denis Sureau - GNU GPL 2.0 license.
The attribute is set to true if caching is allowed, or false if it is not allowed.
You should leave it on false, but for files that are rarely modified. Disabling caching reduces performances on big files, but enabling it could produce bad results.
This method is called by other methods to create an XMLHttpRequest object.
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.
url: The file to load.
callback: The function to call when the file is loaded. It has two arguments, the data and a reference to a tag in the page for storage.
element: An element of the current page.
Load an XML file with any extension.
url: An XML file, with any extension.
callback: Name of a function that will be called in the AALoadXML function. This function has two arguments, an XML document and the reference to an element used for storage.
element: The reference to element given to the callback function.
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 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 tag where to store the extracted data.
Look at the demos for details about the use of this function.
callback: A function with two arguments, the element used for storage (not the id), and a parameter.
id: The identifier of a tag, usually a <div> used for storage of the content of the loaded page.
param: A string, may be the id of a div where to put the data to be displayed.
Called to send data to a script on the server.
url: The script to call with the parameter to sent.
data: A string of parameters in the form: x = y, separated by &.
function: Optional, name of a callback function to call.
The function must have one argument. Anaa assign it with responseText, the XHR's property.
Read the header of a file.
url: A file on the server.
key: A key in the header, such as "server", etc.
element: Tag where to store results of the function.
Extract the content of the body tag from a string holding a web page, so got by the XHR object.
content: A string, usually the content of responseText when loaded.
Return: A string, the part of the page in the body tag.
Free, open source, under the GPL 2.0 license.
You can use the library freely, extend it if you want, but do not remove the copyright notice.