Thinkphp: click the button and process the background action. What should I do? How to respond to this button.

Source: Internet
Author: User
Thinkphp: click the button and process the background action. What should I do? How to respond to this button ?, Please give me a great answer .. Thinkphp: click the button and process the background action. What should I do? How to respond to this button ?, Please give me a great answer ..

Reply content:

Thinkphp: click the button and process the background action. What should I do? How to respond to this button ?, Please give me a great answer ..

It is more convenient to use the link, so that the href OF a points to the path where you want to execute the action, and the parameters can be spelled on the url. If it is complicated, ajax will be used for the request, the principle is the same. Of course, the biggest advantage of ajax is that the page does not jump/refresh

The button triggers a request, which is similar to the request for opening a webpage. Therefore, the backend processes the request normally. (I suggest you post the code to let us know if you want ajax requests or page requests)

Use ajax to request the url of the backend action to perform the operation

After successful callback, you can use js to call back the data returned by the backend.

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.