Coder Social home page Coder Social logo

ga1i13o / python-lab7 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ami-2019/python-lab7

0.0 0.0 0.0 5 KB

Lab n. 7: jQuery+Ajax front-end to REST server (server from https://github.com/AmI-2019/python-lab6)

Python 5.24% CSS 3.75% JavaScript 59.90% HTML 31.10%

python-lab7's Introduction

AmI 2019 - Lab 7: Javascript Ajax Client

The goal of this exercise is to design and implement a front-end (in Javascript, Bootstrap, and jQuery) able to exploit the a set of REST APIs for the todo list manager (developed in Lab 6).

Exercise steps:

  1. See the index.html template: it already gives a (static) example page
  2. Attach an event handler to the "+" button, to insert a new task:
    • collect task name and urgency
    • call the REST POST /tasks service to add the new task
    • use $.ajax to send the JSON description of the new task
  3. Before testing, modify Lab6 to enable CORS (cross-domain) requests, and deploy the two applications (server and front-end) on different ports
  4. Generate the table by querying the REST server for all current tasks.
    • empty the current table
    • use $.ajax for calling the GET /tasks API
    • use the returned value to re-construct the table
    • ensure that the table is reloaded (1) at startup, (2) when a task is added
  5. Enable the delete function for existing tasks
    • register an event handler on the delete icon
    • find the task ID corresponding to the row (suggestion: use data-xxx HTML5 attributes, and $.data('xxx') jQuery function for retrieving them)
    • use $.ajax to call the DELETE /tasks/id API (ensure that CORS allows DELETE)
  6. Enable the edit function for existing tasks

Solution

The solution for all points is in the solution branch

python-lab7's People

Contributors

fulcorno avatar ga1i13o avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.