XOAD HTML - AJAX

XOAD HTML is an extension that allows for the easy updating of HTML page elements using XOAD.The following examples show the use of the XOAD_HTML::getElementByID() and XOAD_HTML::getElementsByTagName() methods, which do exactly the same thing as their equivalent JavaScript DOM methods.

XOAD_HTML::getElementById()
You will recognize the layout of the code in Listing as being similar in structure to the basic XOAD program discussed earlier. Rather than include an external class file, in this example we have defined a class, Updater, within the application itself.The class contains a single function, change().

The first line in that function uses XOAD_HTML::getElementById() to identify the page element with and ID of display. Subsequent program lines proceed to change the text and background color of the page element.

The function change() is made available as a method of the JavaScript object myobj and can then be called like any other JavaScript method:

Figure shows the program’s operation.

Application to Use

Using XOAD_HTML :: getElementById(

Using XOAD_HTML :: getElementById(

XOAD_HTML::getElementsByTagName()
The XOAD_HTML::getElementsByTagName() method, like its JavaScript equivalent, returns an array of elements with a certain element type Listing identifies all page elements of type <div> and changes some of their style attributes.

Changing All Page Elements of a Given Type

The three <div> elements in the page are identified by XOAD_HTML::getElementsByTagName() and have their styles and sizes changed.

Selecting multiple page elements with XOAD_HTML

Selecting multiple page elements with XOAD_HTML


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

AJAX Topics