Documentation:xajax uncompressed.js






Documentation:xajax uncompressed.js

The xajax_uncompressed or xajax.js provides javascript functions. It is taken from comments! t.b.c.

ATTENTION: better documentation forthcoming!

Contents

[edit] Object Methods

[edit] DebugMessage (text)

Writes a debug message either to a popup (if allowed) or an alert window - but only if xajax is in debug mode.

[edit] getRequestObject ()

Returns the XMLHttpRequest Object that is specific to the current browser

[edit] $ (sId)

xajax.$() is shorthand for document.getElementById()

[edit] include (sFileName)

xajax.include(sFileName) dynamically includes an external javascript file

[edit] stripOnPrefix (sEventName)

Used internally to take off the 'on' prefix to an event, if it's there (eg onclick, onblur, onchange becomes click, blur, change respectivly)

[edit] addOnPrefix (sEventName)

Used internally to add the 'on' prefix to an event, if it's not there (eg click, blur, change becomes onclick, onblur, onchange respectivly)

[edit] addHandler (sElementId, sEvent, sFunctionName)

xajax.addHandler adds an event handler to an element

[edit] removeHandler (sElementId, sEvent, sFunctionName)

xajax.removeHandler removes an event handler from an element

[edit] create (sParentId, sTag, sId)

xajax.create creates a new child node under a parent

[edit] insert (sBeforeId, sTag, sId)

xajax.insert inserts a new node before another node

[edit] insertAfter (sAfterId, sTag, sId)

xajax.insertAfter inserts a new node after another node

[edit] getInput (sType, sName, sId)

[edit] createInput (sParentId, sType, sName, sId)

xajax.createInput creates a new input node under a parent

[edit] insertInput (sBeforeId, sType, sName, sId)

xajax.insertInput creates a new input node before another node

[edit] remove (sId)

xajax.remove deletes an element

[edit] replace (sId,sAttribute,sSearch,sReplace)

xajax.replace searches for text in an attribute of an element and replaces it with a different text

[edit] getFormValues (frm)

xajax.getFormValues() builds a query string XML message from the elements of a form object

  • The first argument is the id of the form
  • The second argument (optional) can be set to true if you want to submit disabled elements
  • The third argument (optional) allows you to specify a string prefix that a form element

name must contain if you want that element to be submitted

[edit] objectToXML (obj)

Generates an XML message that xajax can understand from a javascript object

[edit] loadingFunction ()

Override this function to call your custom loading function that notifies the user when the page is taking a while to load. Either:

   xajax.loadingFunction = myCustomLoadingFunction;

or

   xajax.loadingFunction = function(){xajax.$('loadingBar').style.display='block';};

to set either to a predefined loading function, or make one up on the spot.

[edit] doneLoadingFunction ()

As in loadingFunction(), override this function to hide or notify the user that the loading of the page is done.

[edit] call (sFunction, aArgs, sRequestType)

Sends a XMLHttpRequest to call the specified PHP function on the server

  • sRequestType is optional -- defaults to POST

[edit] getBrowserHTML (html)

Gets the text as it would be if it were being retrieved from the innerHTML property in the current browser

[edit] willChange (element, attribute, newData)

Tests if the new Data is the same as the extant data

[edit] viewSource ()

Returns the source code of the page after it's been modified by xajax

[edit] processResponse (xml)

Process XML xajaxResponses returned from the request