Frontend development-preliminary business logic of the comment area on the playback page -- logic

Source: Internet
Author: User

Frontend development-preliminary business logic of the comment area on the playback page -- logic

1. This time mainly involves data interaction between the front and back ends.

Jquery Tutorial:

Http://www.w3school.com.cn/jquery/index.asp

 

2. Engineering address: https://github.com/digitalClass/web_page

Website publishing address: http: // 115.28.30.25: 8029/

 

3. Business Logic description:

    1. The preliminary assumption is as follows:

      1. After the user clicks submit, the front-end will post the comment content and user userid to the backend,

        1. The currently scheduled route is/Addcomments /,Modifiable

        2. In addition to some data provided by the backend at the beginning,

        3. Backend needs are also involvedLogin User's UseridAndLogin UserUsernameThese two attributes enable the front-end to display data after submission.

      2. The backend needs to return a json data structure:

        1. If the successful code is marked as 0 and the code is not 0, the front-end considers the submission failed.

          1. Shape:

            1. {'Code': 0}

        2. At the same time, the backend can return a msg field to indicate the error message \

          1. Shape:

            1. {'Msg ': "Unknown error "}

 

4. Display Results

Comment page

 

Error message:

 

 

Dynamic comment loading effect:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.