0% found this document useful (0 votes)
1K views

Ajax Exercises

This document outlines a series of exercises to learn Ajax basics: 1. Make a button that directly shows an alert without JavaScript or Ajax. 2. Make a button call a JavaScript function to show an alert without Ajax. 3. Make a button use Ajax to show an alert with contents from an HTML file. 4. Make a button use Ajax to show an alert with contents from a JSP page.

Uploaded by

lgunityz
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Ajax Exercises

This document outlines a series of exercises to learn Ajax basics: 1. Make a button that directly shows an alert without JavaScript or Ajax. 2. Make a button call a JavaScript function to show an alert without Ajax. 3. Make a button use Ajax to show an alert with contents from an HTML file. 4. Make a button use Ajax to show an alert with contents from a JSP page.

Uploaded by

lgunityz
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Exercises: Ajax Basics

1. Make an HTML page with a pushbutton that directly pops up an alert box. You do not need to
load a JavaScript file to do this: your pushbutton can just directly call ‘alert("Hi")’. Note that
there is no Ajax involved yet, and no <script> tags.

2. Make an HTML page with a pushbutton that calls a JavaScript function that pops up an alert
box. The difference here from problem 1 is that the pushbutton invokes a JavaScript function
that you wrote, so you have to load the JavaScript file with the <script> tag. There is still no
Ajax involved yet.

3. Make an HTML page with a pushbutton that pops up an alert box, where the contents of the
alert box are taken from an HTML file. Now you need to use the Ajax process.

4. Make an HTML page with a pushbutton that pops up an alert box, where the contents of the
alert box are taken from a JSP page.

5. Make an HTML page with a pushbutton that pops up an alert box, where the contents of the
alert box are taken from a servlet.

6. Make an HTML page that has a pushbutton. When you press the pushbutton, a bulleted list of
random numbers should pop up inside the HTML page. Use a single JSP page to create the
bulleted list.

7. Redo #6, but use MVC on the server to build the bulleted list.

8. Make a server-side resource that returns two random numbers, represented in XML like this:
<?xml ...>
<numbers>
<number1>0.1234</number1>
<number2>0.5678</number2>
</numbers>

Make an HTML page that has a pushbutton. When you press the pushbutton, a bulleted list of
two numbers should pop up inside the HTML page.

http://www.coreservlets.com

You might also like