MVC is an abbreviation of three letters:
Modol Mode
Controller
View
The traditional MVC view is a Web page that displays various content.
The controller is a traditional dynamic interaction between CGI, PHP, or ASP. NET and servers.
The MVC data stream is integrated into the view to display the response data based on interaction.
Use MVC in Ajax to design webpages:
Benefits: division of labor is the mainstream in the future.
Artists engage in artists, programming, and so on.
View in Ajax: provides a visual interface to Monitor Interface operations
Interact with the Controller to display the required data
View Example: for example, a web page: design the display style of a Web page, what is displayed on the web page, and what controls are available,
As for business logic, no need to understand, no need to design, only design the appearance of the web page, so no other knowledge,
You only need to design webpages, and use CSS to design styles.
Do not include the logical part in the View:
Although the above use is correct, it does not comply with MVC, because it will bring confusion to the artist. The correct method is: a good artist is a genius. Sometimes I want artist Picasso.
The appearance of a webpage can play a decisive role, so it is necessary for the artist to be professional (or not very good, the artist must know
What does onclike mean? This will reduce the professionalism of the artist, but this method is acceptable to the artist)Then, design such a function in the business logic layer.
ABC (event) {showresult ("data. xml", "name ");}
The artist can use only one function name, but does not need to know anything else. They only need to know that this is a click event. A good artist should focus on using existing parts.
Create a beautiful Web interface without worrying too much about it. The more professional the artist works, the more helpful the design.