Java Reference
In-Depth Information
Table 10.1: AJAX Components
Technology AJAX Use
HTML/XHTML and CSS CSS allows AJAX applications to format their display. By us-
ing CSS, the HTML documents can be kept relatively simple,
which makes them easier to be modified by the DOM.
DOM The Document Object Model allows JavaScript to modify the
data currently displayed on the web browser. The DOM also
allows JavaScript to parse XML.
XMLHttpRequest Object The XMLHttpRequest object allows you to exchange data
asynchronously with the web server through HTTP requests
and responses. Some AJAX applications use an embedded
<iframe> to accomplish this as well.
XML
XML, or some other textual format, is the format usually used
for AJAX applications to communicate with the web server.
AJAX web sites can actually be easier to navigate with a bot than regular web sites. AJAX
web sites tend to be designed so that their JavaScript can request information from the server
in short simple XML packets. This can be ideal for a bot. Programming a bot is just a matter
of understanding what format these small requests are in.
Understanding AJAX
To understand this format, you must understand how AJAX works. There are entire
topics dedicated to AJAX. This chapter will just present a brief introduction to AJAX. The
focus is on how to access AJAX with a bot, not how to actually program AJAX.
Another option, beyond understanding how AJAX works, is simply to use a network ana-
lyzer. If you use a network analyzer, you can watch the web browser communicate to the web
server. You will see the AJAX requests and responses. From this information, you can then
build a bot to send these same requests. Using a network analyzer to analyze AJAX will be
discussed later in this chapter.
In the next few sections, this chapter will present a brief overview of how AJAX works.
Using HTML/XHTML and CSS
AJAX web sites will use the Document Object Model (DOM) to modify their HTML pro-
grammatically. Rather than calling on the web server to completely redraw the entire HTML
page, AJAX applications will request data from the server and then modify the page the user
is already looking at. Because if this, it is best to keep the HTML as simple as possible. Cas-
cading Style Sheets (CSS) is a great way to do this.
Search WWH ::




Custom Search