1.8.
16 1 What is Ajax?
Fig. 1.8 JavaScript File Structure
JavaScript editor also provides refactoring to rename or delete a
variable or function. To refactor, right-click and select Refactor>Rename
or Refactor>Delete Safely as shown in Fig. 1.9.
Fig. 1.9 Refactoring
1.8 Summary 17
To add the JavaScript file to a JSP drag and drop the file from the
Application navigator to the JSP. A element for the
JavaScript file gets added to the JSP as shown in Fig. 1.10.
Fig. 1.10 Adding JavaScript to JSP
1.8 Summary
In this chapter we discussed the XMLHttpRequest object, which forms
the basis of Ajax. An Ajax request is initiated from a browser by first
creating an XMLHttpRequest object and opening the
XMLHttpRequest object using the open() method. The method used
to create the XMLHttpRequest varies with the browser used. An Ajax
request is sent using the send() method of XMLHttpRequest. When
the request completes the Ajax XML response is retrieved using the
responseXML attribute of the XMLHttpRequest object. The web
page that sent the Ajax request is updated with the Ajax XML response by
retrieving the XML data and setting the data into the web page elements
using DOM functions. We also discussed the JavaScript Editor integrated
into JDeveloper 11g.
2 Developing an Ajax Web Application
2.1 Introduction
As we discussed in the previous chapter Asynchronous JavaScript for
XML (Ajax) is a web technique that combines JavaScript, Document
Object Mode (DOM) and XMLHttpRequest technologies to provide
dynamic interaction between a client and a server.
Pages:
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42