
Web Services and AJAX • 433
9.2.6 Role of XML in Ajax – Case Study
Let us now discuss the role of XML in Ajax. For this, we shall consider a simple case study. Here, we want
to show a button to the user titled Get sandwiches. When the user clicks on this button, we would internally
call a JavaScript function named getSandwiches (). This function downloads a file named sandwiches.xml
from the Web server. The button is also connected to a drop-down list control to display the sandwiches in a
user-understandable manner.
We will approach this requirement in a slow, step-by-step manner to facilitate our understanding, instead
of jumping to the final ...