We then need to access the sub-nodes name and text. From these we can create
an XHTML string with which to update the page.
This example shows how we do this using the responseXML object's
documentElement property and the Element object getElementsByTagName()
method and nodeValue property:
// Update the page
this.send({ onComplete: function(response, responseXML)
{
// get the XML nodes
var root = responseXML.documentElement;
var name = root.getElementsByTagName('name').item(0);
var text = root.getElementsByTagName('text').item(0);
// prepare the XHTML
var updateValue = '
'
+ name.firstChild.nodeValue + '
'
+ text.firstChild.nodeValue + '
';
}});
There is one last thing we need to do. We must update the page with the new value.
We do this at the end of the onComplete function:
// Update the page
this.send({ onComplete: function(response, responseXML)
{
// get the XML nodes
var root = responseXML.documentElement;
var name = root.getElementsByTagName('name').
Pages:
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398