CSI2132 Homework 5 AJAX solved

$35.00

Category: You will receive a download link of the .ZIP file upon Payment

Description

5/5 - (1 vote)

Objective 1: AJAX GET
Add some content to your site that is requested and displayed on the page with an AJAX GET request after
the page loads. The content can be plain text.
Example:
● Page loads as usual
● After the page loads, your JavaScript runs and makes an AJAX GET request to your server
● The server responds with plain text that is added to an HTML element and displayed to the user
Objective 2: AJAX POST
Add a form to your page that does not reload the page when submitted by sending an AJAX POST request.
You have flexibility in your design as long as the user can send information to your server without a page
reload.
● You do not have to use the form HTML element. Using inputs and a button that calls your JavaScript
function and pulls the values from each input is fine
● You choose how your data is represented in the body of the request (Ex. url encode, multi-part,
JSON)
The sent information must be stored on your server.
Objective 3: AJAX GET User Content
Add a path to your server that will respond with all the content submitted with your AJAX POST from
objective 2. Do not host this as a separate HTML page. Aside from not hosting a whole page, you may
choose any format for sending this data (Ex. JSON, a preformatted HTML element, CSV, plain text).
Objective 4: Polling
Use polling to request and display the content served in objective 3 at regular intervals. To earn any credit for
this objective, your site must not be vulnerable to HTML injection attacks. With this objective complete you
should be able to:
● Open you site in two different tabs/windows
● Submit your form in one tab
● See your submission in the other tab without refreshing the page or taking any other action
At this point you’ve effectively written a chat app with only a TCP socket server!
Submission
To earn credit for this homework you must complete all 3 submissions.
1. Submit all the files of your site to AutoLab in a zip file
2. Submit your report to AutoLab as a txt file
3. Fill out the homework self-grading form