xajax

xajax is a PHP class library for easily creating powerful PHP- driven, Web-based AJAX applications.
Download

xajax Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • J. Max Wilson
  • Publisher web site:

xajax Tags


xajax Description

xajax is a PHP class library for easily creating powerful PHP- driven, Web-based AJAX applications. xajax project is an open source PHP class library for easily creating powerful PHP-driven, web-based AJAX Applications. Using xajax, you can asynchronously call PHP functions and update the content of your webpage without reloading the page.xajax is designed to be easy to implement. To keep the presentation markup relatively clean and avoid having to create a lot of JavaScript functions to update your web content, xajax allows you to control a great deal of your content through XML responses from your PHP functions.The xajax class creates javascript wrappers for specified PHP functions and generates the necessary javascript support functions to permit you to call them asynchronously through XMLHttpRequest from any HTML event, such as onclick.xajax's real power lies in the way it allows you to communicate with and manipulate your application through commands sent back from the server. There is no need to create a multitude of javascript handlers or callback functions to handle the data returned from asynchronous requests. The javascript generated by xajax includes a message-pump, of sorts, that parses XML responses returned from your PHP functions and executes the commands contained therein. A single XML response can contain any number of commands.The xajax library includes an easy-to-use class to make creating these XML responses extremely easy. The xajax XML Response commands currently available include Assignment, Prepend, Append, Search and Replace, Alert, and custom Javascript commands. For example, let's say that a user clicks on a button in your AJAX application. The onclick event calls the javascript wrapper for a PHP function. That wrapper sends an asynchronous request to the server through XMLHttpRequest that calls the PHP function. The PHP function does a database lookup. You use the xajaxResponse class to generate XML commands to send back to the xajax message pump in your application: $objResponse = new xajaxResponse(); $objResponse.addAssign("myInput1","value",$DataFromDatabase); $objResponse.addAppend("myDiv1","innerHTML",$DataFromDatabase2); $objResponse.addPrepend("myDiv2","innerHTML",$DataFromDatabase3); $objResponse.addReplace("myDiv3","innerHTML","xajax","xajax"); $objResponse.addScript("var x = prompt("Enter Your Name");"); return $objResponse->getXML();The xajax message pump would parse the XML message and perform the following:1. The value of the element with id myInput1 would be assigned to the data in $DataFromDatabase.2. The data in $DataFromDatabase2 would be appended to the innerHTML of the element with id myDiv1.3. The data in $DataFromDatabase3 would be prepended to the innerHTML of the element with id myDiv2.4. All occurrences of "xajax" in the innerHTML of the element with id myDiv3 would be replaced with "xajax"; making all of the instances of the word xajax appear bold.5. a prompt would be displayed asking for the user's name and the value returned from the prompt would be placed into a javascript variable named x.All of this is implemented on the server side in the PHP function by forming and returning an xajax XML response. The presentation markup remains remarkably clean because you don't have to create a bunch of callback handlers for your asynchronous requests.At the same time, xajax is designed to be extremely flexible and leave you, the programmer, in control.What's New in 0.5 RC1 Development Release:New in 0.5 RC1 since Beta4:xajax PHP Changes:* Added configuration option for response queue size* Added optional third argument ($sId) for includeScript() / includeScriptOnce()* Added optional media type for ->includeCSS()defaults to 'screen'* Added optional script type for ->includeScript()/->includeScriptOnce() defaults to 'text/javascript'* Several minor bug fixes and improvements* Fix for bug when passing bool value from browser to server * decodeUTF8Input is now default true when XAJAX_DEFAULT_CHAR_ENCODING is set to other encoding than 'utf-8'* Fixed minor bug in argument manager (empty parameters error)xajax JavaScript Changes:* Added code to properly detect duplicate CSS files when Media type isspecified, changed response handlers to only send media type, script typeand script ID if they are specified, else default value is added on browserside, clean-up / update of start-up code for JS modules.* Cleaned up the command handler registration and built in command handlers.* Fix for getFormValues. name="foo[]" will now return a single array no matter which type of field* Added translations in en, de, es, fr, nl, tr and bg.Thanks to all contributors!* added support for variable type transfer accross request -> response.* minor bug fixes in xajax_core.js* Added header parameter for xajax.request() to add additional HTTP headerinformations.* Tested on Internet Explorer 7.0, Firefox 2.0.0.6, FireFox 3.0.1, Opera 9.23----New in 0.5 Beta 4 since Beta 3:xajax PHP Changes:* Resolved issue with argument parser / decoder that could cause an infinite loop condition when a malformed request is sent to the server.* Added the ability to compile the xajax core files into a single include file, thus reducing load time. The compiled core has been stripped of all code comments, debug code and error trapping code. It is designed to be used on a production server with production ready xajax enabled pages (which have already been tested with the standard version of the xajax core).* Fixed issues in the script deferral feature that was introduced in beta 3 so that plugins are included in the correct order.* Added the ability to load an alternate language module that can provide debug, error and status message text in the desired language.* Tested on PHP 4 (4.3.10), PHP 5 (5.1.4, 5.2.2) and the Zend Core 2.0xajax Javascript Changes:* Identified and resolved memory leak issues.* Added the ability to load an alternate language module that can provide debug, error and status message text in the desired language.* Improved / fixed issues with the newly renovated xajax.getFormValues: 1) Fixed the handling of input field names formatted as an array 2) Improved performance and organized the code* Tested on Internet Explorer 7.0, Firefox 2.0.0.6, Opera 9.23----New in 0.5 Beta 3 since Beta 2:xajax PHP Changes:* Modified the plugin system so that plugins can effect the initial page load, the request processing and response processing phases.* Added / updated plugins to support the existing function registration, registration of callable objects and a new server side event processing registration.* Added a script generation deferral feature that allows xajax to insert a SCRIPT tag with a src attribute referring back to the xajax request URI that will then generate the client side javascript code. Style blocks generated by the loaded plugins will be handled in a similar manner.* Added xajaxUserFunction class to aide with the specification of a user call back function. The xajaxUserFunction objects can be used when registering functions and can include a reference to an include file.* Updated the function registration process so that functions can be registered in a variety of ways depending on which plugins are loaded. New registration methods can be added by adding a plugin to support the registration method and handle the processing of the functions specified.* Call options can now be specified when functions are registered. When the associated plugin accepts the function registration, the call options are saved; when the javascript function stubs are generated, the call options are included. Thus, each javascript stub function can be customized from within the PHP script. This elliminates the need to call xajax.call or xajax.request directly (in most cases).xajax Javascript Changes:* Added xajax.request function to replace xajax.call and provide support for the latest core changes that allow greater flexibility in registering functions, callable objects and server side event processing.* Added a context member to the request object so that the caller can set an object or value to be maintained throughout the processing of the request. Added response commands that allow the php script to effect the context object or value.* Reworked the xajax.getFormValues function to add two new features: 1) You can now request that getFormValues return only a portion of your form by passing the ID of a DIV tag or similar that contains the input controls to be read. 2) You can now access the return value of getFormValues as a javascript array. In prior versions, you would receive a string that could be transmitted to the server, but it was not very useful on the client side. Instead, you can read those values in your javascript and / or send them to the server as needed.----New in 0.5 Beta 2 since Beta 1:xajax.inc.php changes:* Modified portions of the code to allow PHP functions registered with xajax to optionally return text or XML data other than a response object that can be handled by a custom response handler function. These kinds of function must be called using xajax.call with a parameter that indicates the function that will handle the response. To use it the allowAllResponseTypes flag must be set to true.* New useUncompressedScripts flag allows you to switch to using the uncompressed* Javascript files easily.* The risk of cross-site scripting attacks via the automatic URI detection has* been dimished through additional protection.xajaxResponse.inc.php changes:* New removeScript and removeCSS methods to unload Javascript or CSS files in the client* New waitForScript and waitForCSS methods to attempt to load Javascript or CSS files and hold off on processing further commands until they're loaded or the queue times out.* New xajaxCall object you can use to assemble Javascript code for xajax.call quickly.Javascript engine:* It's new and it's shiny! Inside of xajax_core, there are ten modules: * xajax is the main module which handles the basic call/request/response lifecycle * xajax.callback allows functions to be called during the response lifecycle * xajax.config stores the run-time configuration of the xajax engine * xajax.css contains functions that manipulate stylesheets * xajax.dom contains functions that manipulate the HTML DOM * xajax.events contains functions that setup run-time DHTML events * xajax.forms contains functions that help you construct HTML forms * xajax.js contains functions that handle Javascript files * responseProcessor contains the default xajax XML response processor (with more to come) * tools contains some miscellaneous utility functions


xajax Related Software