Web Request Response

Source: Internet
Author: User

Reprinted from: Sanmaospace

Definition of 1.WEB development
First look at Microsoft's definition of Web development:
Web development is a generalized term used to refer to Web pages or Web site authoring processes. Web pages are written using HTML, CSS, and JavaScript. These pages may be simple text and graphics that resemble documents. The page can also be interactive, or display a change of information. Writing interactive Server Pages can be a little more complicated, but it's possible to implement richer Web sites. Most of today's pages are interactive and offer modern online services such as shopping carts, dynamic visualizations and even complex social networks.

In layman's parlance, web development is what we call a Web site. It is divided into Web Parts and logical parts that we say the foreground page display and background business logic processing. The foreground is responsible for displaying the data interactively with the user, using the HTML tag layout page, CSS style rendering page, JavaScript script (or Ajax, JQuery, ExtJS) to write dynamically interactive pages, and writing procedures for dealing with some complex business logic in the background. can use C#,java , PHP and other languages.

2.Web Request Response Simple comprehension
Demo Diagram of client browser making one request to server side:


<1>. The client sends the request. The client browser sends the request URL to the server;
<2> The server receives the request. The server receives the request sent by the browser;
<3>. server generates HTML. The URL of the server resolution request, which determines the requested target resource file according to the URL;
This resource file is usually the network address of a dynamic page (such as a file such as Asp,php,jsp,aspx) (a program exception to the MVC structure). The Web server generates an HTML page by invoking the appropriate resource (database data or picture file, etc.) to organize the data based on the contents of the dynamic paging file and the parameters in the URL.
<4> The service side responds to the request. After the HTML document is generated, the server responds to the browser's request and sends the resulting HTML document to the client browser;
<5> The client receives the response. The browser receives the request from the server to make the HTML document;
<6>. client parsing HTML. The browser parses the HTML document and loads the relevant resource files (JS,CSS, multimedia resources, embedded pages), etc. (the browser will render the HTML document after it has been finished, but it will also send a request to the server to request other related resource files)
<7>. The server sends the resource file. The server receives the browser request to the resource file, and responds the corresponding resource file to the client browser;
<8>: The client loads the resource file. The client browser will receive the resource files sent by the server, organize and render to the page;
<9>: The client loads from top to bottom. When the page is rendered, the browser executes the HTML document from top to bottom, and when the corresponding page script is encountered, the script is parsed and the corresponding script code is interpreted.

After the 6th step, we can see part of the page content, but may be plain text content, no style, no pictures or other resources. When the browser requests to get a resource, it will organize the rendering, until all the resources of the entire page are loaded, the display is complete, and the request response is completed.

3. Client parsing HTML
<1> parse HTML structure;
<2> load external scripts and style sheet files;
<3> parse and execute script code;
<4> Constructs an HTML DOM model;
<5>. Loading external files such as pictures.

"http://www.w3.org/1999/xhtml">"Server"><title>title</title><style type="Text/css">Body{font-sie:12px;}</style><link href="Style.css"Rel="stylesheet"Type="Text/css"Media=" All"/><script src="Js.js"Type="Text/javascript"></script>"Text/javascript">function F1 () {}</script>"1.gif"/></div><script type="Text/javascript">function F2 () {}</script></body>

html→head→title→ #text (page title) →style→ load style → parse style →link→ load external style sheet file → parse external style sheet →script→ load external script file → parse external script file → execute external Script →body→div→script→ load script → parse script → execute script →img→script→ load script → parse script → execute script → load external image file → page initialization complete

4.onload and ready differences
The difference between the onload and ready is to be noted here:
One is ready, indicating that the DOM document tree has been loaded parsing and parsing completed (not including pictures and other non-text media files);
The second is onload, which refers to all the resources on the page (all elements including images, etc.) are loaded.

Say ready is faster than onload the most significant is that a page has a large picture, loading for a long time, onload only after the picture is loaded, and ready does not have to wait for the picture to be loaded.
This difference is consistent with the Window.onload and $ (document). Ready ().

5.WEB Related technologies and standards

Web Request Response

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.