Home Lab 1 Lab 2 Lab 3 Lab 4 Lab 5 Lab 6 Github ➚

Lab 5 • jQuery and AJAX

1. Get familiar

a. What you can do with the jQuery?

jQuery is a Javascript framework which simplify the developer to do some stuff, like events, DOM elements selection, make effects and animations, use Ajax and Json, also extends abilities through plug-ins, and more.

b. How it can help you as web developer?

It can simplify a code, for readability for example, and also the number of lines written.

c. If you think our earlier participant list app, in what kind of issues you could use jQuery?

Maybe we could use jQuery to select the elements when we want to delete some items.

d. What are CDNs? What kind of benefits you get if you use them?

CDNs, for Content Delivery Networks, are geographically distributed networks of proxy servers and their data centers [Wikipedia]. They permit the developer to include remote scripts and run them in its own web page.

For example, if the developer want to include a framework (like jQuery, Bootstrap, Tween...), he can either download the script, so this will be locally available on his website but not up-to-date, or link the remote script and will be always up-to-date.

The most advantage to do that is that the framework is always up-to-date and permits the developer to save space by non including third-part packages, but the main drawback is that his webpage is dependent of the remote server, so if this stop working, his webpage will also do, or if the server is hack and the script is replaced by a malware, he also will be affected.

2. Person list with jQuery

Take again our person list, and use jQuery when applicable.
Indeed, I replaced classic JS by jQuery when displaying all elements (in personView) and when looking for checked checkboxes to delete selected elements (in personController).

3. Use AJAX and JSON to display a contact list

Use jQuery and AJAX to read a JSON file which contains a list of persons with their own email address.