Client and service-side relationships

Source: Internet
Author: User
Tags ruby on rails
Client and service-side relationships
Many people do not know the relationship between the client and the server when learning programming, so let me give you an analogy to explain the secret between the client and the server.

I like to go to the steamed restaurant in the university, because it is close, then I came in to find the sale of the elder sister told her that I want a bowl of Chongqing noodles, she will be shouting after the kitchen: "Noodle A", soon she went to the kitchen for me on a bowl of hot noodles, put the seasoning and told me: "Your face. The face of his family in our school can also, mainly cheap, delicious, small amount, for weight loss of me is more appropriate. Here, the sister who sells noodles is a waiter, I am a client.

The relationship between the Internet browser and the website is like the relationship between me and the restaurant. This relationship contains a large number of requests and responses. My request is a bowl of noodles, the response of the kitchen is to do my face and end to me.

For example, you are looking at a group of beautiful/handsome pictures, of course, I default you are browsing on the site, then your computer's Internet browser is the client, and the computer running the map is the server. Your browser sends the request to the server on the map via the Internet, and the server then sends you the corresponding page as a response. Next, your browser will render the page on the screen.

In this relationship, we say that the response returned by the image is the client code that will be processed by the browser. In the example mentioned earlier, the response is to give me the noodles, and my dining table is like a Web browser, put a bowl of noodles on the table, I can enjoy.

What happens before we pass the page response (primarily the creation of the page) becomes the server code (Java is the service-side language). In the example of a steamed restaurant, the service-side code is what happens in the kitchen. I'm not going to the kitchen, and I can't see what they've been through to make the meal.

Remember, the kitchen is like a server, and the waiter is like the Internet. The website does not make public what it does in the "kitchen". Web sites may use PHP, ASP. NET or other programming languages.         Whatever happens in the kitchen doesn't affect my browser, as long as it delivers the correct client code. The response we received at the client is actually HTML, CSS and JavaScript code (in Firefox, F12, you can open the developer tool to see all the client code) the client is everything that happens in the user's browser (in this case, the client scope is more, the app belongs to the client) , and the service side is everything that happens on the server running the Web site.


When we talk about client-side code, we usually refer to HTML, CSS, and JavaScript. When we refer to server-side code, we often refer to some server-side languages, such as: ASP. NET, Ruby on Rails, or Java.

A brief article explains the relationship between the server and the client, hoping to help you.

Welcome to Small Bai Qun: 367313759

I qq:751076514, welcome to discuss

Welcome reprint, please indicate the source

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.