.. You may want to use the usual include line. Uncomment and adjust the path.
.. include:: ../Includes.txt
==================
EXT: xajax library
==================
:Author:
Kasper Skårhøj
:Created:
2002-11-01T00:32:00
:Changed:
2009-12-18T07:33:22.500000000
:Classification:
gg_xajax
:Description:
The keywords help with categorizing and tagging of the manuals. You can combine two or more keywords and add additional keywords yourself. Please use at least one keyword from both lists. If your manual is NOT in english, see next tab "language" ---- forEditors (use this for editors / german "Redakteure") forAdmins (use this for Administrators) forDevelopers (use this for Developers) forBeginners (manuals covering TYPO3 basics) forIntermediates (manuals going into more depth) forAdvanced (covering the most advanced TYPO3 topics) see more: http://wiki.typo3.org/doc_template#tags ----
:Keywords:
forDevelopers, xajax, library
:Author:
Marco Malagoli
:Email:
marco@gasser-gasser.ch
:Info 4:
:Language:
en
|img-1| |img-2| EXT: xajax library - gg\_xajax
.. _EXT-xajax-library:
EXT: xajax library
==================
Extension Key: gg\_xajax
Language: en
Keywords: forDevelopers, xajax, library
Copyright 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White &
J. Max WilsonCopyright 2005-2007 by Jared White & J. Max Wilson
This document is published under the Open Content License
available from http://www.opencontent.org/opl.shtml
The content of this document is related to TYPO3
\- a GNU/GPL CMS/Framework available from www.typo3.org
.. _Table-of-Contents:
Table of Contents
-----------------
`EXT: xajax library 1 <#1.EXT:%20xajax%20library|outline>`_
**`Introduction 3 <#1.1.Introduction|outline>`_**
`What does it do ? 3 <#1.1.1.What%20does%20it%20do%20_|outline>`_
**`Tutorial 4 <#1.2.Tutorial|outline>`_**
**`Online documentation 5 <#1.3.Online%20documentation|outline>`_**
**`Known problems 6 <#1.4.Known%20problems|outline>`_**
**`ChangeLog 7 <#1.5.ChangeLog|outline>`_**
.. _Introduction:
Introduction
------------
.. _What-does-it-do:
What does it do ?
^^^^^^^^^^^^^^^^^
xajax is an open source PHP class library implementation of AJAX that
allows developers to create web-based Ajax applications using HTML,
CSS, JavaScript, and PHP. Applications developed with xajax can
asynchronously call server-side PHP functions and update content
without reloading the page.
Xajax is copyright by Jared White, J. Max Wilson, Joseph Woolley &
Steffen Konerow.
Xajax is released under the terms of the BSD license.
.. _Tutorial:
Tutorial
--------
Xajax is designed to be extremely easy to implement :
1. Include in your extension the xajax class library
::
require_once (t3lib_extMgm::extPath('gg_xajax') . 'xajax_core/xajax.inc.php');
2. Instantiate the xajax object
::
$this->xajax = t3lib_div::makeInstance ('xajax');
3. Configure xajax (see xajax website for a complete list of the
available configuration settings)
::
$this->xajax->configure('wrapperPrefix',$this->prefixId);
$this->xajax->configure('characterEncoding','utf-8');
$this->xajax->configure('decodeUTF8Input',true);
4. Register the names of the PHP functions you want to be able to call
through ajax
::
$this->xajax->register(XAJAX_FUNCTION,array('myFunction', &$this, 'myFunction'));
5. Write the PHP functions you have registered and use the
xajaxResponse object to return XML commands from them
::
function myFunction($data) {
// do some stuff based on $data like query data from a database and put it into
// a variable like $newContent
$newContent = 'value of data: ' . $data;
// instantiate the xajaxResponse object
$objResponse = t3lib_div::makeInstance ('xajaxResponse');
// add a command to the response to assign the innerHTML attribute of the element with
// id=”someElementId” to whatever the new content is
$objResponse->assign('someElementId','innerHTML',$newContent);
// return the xajaxResponse object
return $objResponse;
::
}
6. Before your script sends any output, have xajax handle any
requests:
::
$this->xajax->processRequest();
7. Include the necessary JavaScript:
::
$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] = $this->xajax->getJavascript (t3lib_extMgm::siteRelPath('gg_xajax'));
8. Call the function from a JavaScript event or function in your
extension
::
xajax test
That's it. xajax takes care of most everything else. Your biggest task
is writing the PHP functions and returning xajax XML responses from
them-- which is made extremely easy by the xajaxResponse class.
.. _Online-documentation:
Online documentation
--------------------
Online documentation for this class is available on the xajax website
at `http://xajaxproject.org `_
.. _Known-problems:
Known problems
--------------
None yet. Please tell me if you find something.
.. _ChangeLog:
ChangeLog
---------
See the Changelog file inside extension
7
.. ######CUTTER_MARK_IMAGES######
.. |img-1| image:: img-1.png
.. :align: left
.. |img-2| image:: img-2.png
.. :border: 0
.. :height: 21
.. :hspace: 9
.. :id: Grafik2
.. :name: Grafik2
.. :width: 87