var msg=xmlHttpReq.responseXML;
With the XML stored in the msg variable, we retrieve the element's
value using the DOM method getElementsByTagName().
var catalogId=msg.getElementsByTagName(
???catalogId???)[0].firstChild.nodeValue;
Finally, we test the element value to create a message that we display
by updating the HTML content of the validationMessage div on the
Web page, using the innerHTML property.
if(catalogId==???valid???){
var validationMessage =
document.getElementById(???validationMessage???);
validationMessage.innerHTML = ???Catalog Id is
Valid???;
}
else
{
var validationMessage =
document.getElementById(???validationMessage???);
validationMessage.innerHTML = ???Catalog Id is
not Valid???;
}
That's the full cycle. The XMLHttpRequest object provides dynamic
interaction between a client and a server by transferring data without
posting the Web page to the server. We use JavaScript to launch a request
and process the return value, and then we use browser DOM methods to
update data on the page. We are using Oracle JDeveloper 11g IDE for
Ajax, because JDeveloper 11g provides an integrated JavaScript Editor for
Ajax/web development. We shall discuss the JavaScript Editor next.
1.7 JDeveloper Integrated JavaScript Editor
JDeveloper 11g includes an integrated JavaScript editor for creating
JavaScript. In a JDeveloper web application JavaScript may be added
directly to a JSP file, but the JavaScript may also be created in a separate
.
Pages:
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39