Front-end development--Play page comment area business logic Preliminary

Source: Internet
Author: User
Tags code tag

1. This time mainly involves data interaction at the front and back end

jquery Tutorial:

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

2. Project Address: Https://github.com/digitalClass/web_page

Site Address: http://115.28.30.25:8029/

3. Description of Business logic:

    1. The tentative idea is this:

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

          1. the temporarily scheduled route is /addcomments/and can be modified

          2. So in addition to some of the data provided at the beginning of the backend,

          3. Also related to the backend need to login user userid and login user username These two properties, easy to display data after the front-end submission

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

          1. Where if the successful code tag is 0, if code is not 0, the front end will consider the commit unsuccessful

            1. Shaped like:

              1. {' Code ': 0}

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

            1. Shaped like:

              1. {' msg ': ' Unknown Error '}

4. Display effect

Comment Page

Error message:

Comments Dynamic Loading effect:

Front-end development--Play page comment area business logic Preliminary

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.