Javascript-during Project creation, is an ajax request corresponding to a php file or is php code written in a file?

Source: Internet
Author: User
If the php file is written separately, it will be messy. how can we classify the php file? How can I deal with the response of different requests more efficiently when multiple ajax files correspond to one php file? If the php file is written separately, it will be messy. how can we classify the php file?
How can I deal with the response of different requests more efficiently when multiple ajax files correspond to one php file?

Reply content:

If the php file is written separately, it will be messy. how can we classify the php file?
How can I deal with the response of different requests more efficiently when multiple ajax files correspond to one php file?

Users should be classified based on the service category rather than Requests. for example, requests for users have User information and User information modified. these requests are closely related to users, you can put the processing logic in a php file.

It is true that an ajax request is a PHP request, and there is no logic error even if it is written like this; it is just used to using another php proxy for all requests, such as gateway; in this way, the front-end only needs one Address Prefix. the specific operations are attached to this prefix, which makes it easier to manage programs during later maintenance and development. In addition, this method is suitable for server topology management, such as reverse proxy or server load balancer;

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.