After programming a sense of learning - the wrong place, please point it out

A semester before I did and landlord almost do not know what these are, after a semester almost all the hang of it, to say something about their own understanding of it> <contact because the time is not very long, wrong place please correct me -
site visits service process
must first know what a website is visited about process:
suppose you enter the problem in the browser address bar address
http://www.zhihu.com/question/22689579
access process and the following figure is similar to the browser and server exchange , server and database exchange (sometimes in the database on the server host that)

HTML and CSS
then you got a home computer html (that is, body HTTP response of the contents on the map), will be parsed rendering. HTML is a markup language. Analogy a bit, we often use some code to add rich text content in the forum, give some chestnuts:
[img] Picture address [/ img]
is used to map
[url] Hyperlink [/ url]
to paste the address
[del] Oh [/ del]
represents the label in the text should be deleted (default strikethrough effect)
of this Code forum is a markup language, HTML and it's role is similar. Server back to your html file inside, written some code something like this:
After the browser to get the code, you render good to analyze the page is displayed, if not css, effect is that, according to the browser the default style displays a list, pictures, hyperlinks, input boxes, buttons, and so on:

Is not that the default style a little blind dog eyes see it ...... So many times we need to customize the style, the style of the existing general provisions of the language is CSS, we can use it to write some code to define the style, and then in a html file the label associated with these provisions styles CSS code and expressed semantic content of the HTML code up, and then you will be able to see the page in line with a normal human aesthetic of:

The basic format of the CSS code is
the attribute: value of
such know almost the blue top navigation bar, it is about such a CSS

The first attribute code corresponding translation adults, then, is its location (position) should not be fixed (fixed), the browser will work diligently to implement the code required to achieve the effect, so you turn the page to turn in go to the top of the navigation bar are tightly glued to the top of the window does not follow scrolling.
Then let several other properties which do chestnuts explain is:
left and top navigation bar of zero indicates that mattered close to the upper left corner of the window
width and height specify the width and height of the navigation bar
background indicate that the setting is the navigation bar a gradient blue
browser will be based on the CSS code, "painting" a corresponding style.

HTML 5 and XHTML
like human languages, on the web page in the HTML code is not necessarily standard, like sometimes you pronunciation is not standard, people will have to guess what you say in the end is the same, sometimes front-end program ape accidentally wrong HTML, the browser will try to guess what they originally wanted to write, doing the corresponding rendering, and guess common sense to do is to have a basis. Some browsers support plus some labels, some do not support, and other chaotic situation, in order to prevent everyone Chicken and Duck Talk, we need to have any HTML code tags, labels, how to write, what can label these properties there are certain consensus, establish a prevailing standard, HTML5 is one of a relatively new standard. The new standard can be used plus a lot of tags and attributes, then the major browsers Hangchihangchi according to this standard to achieve many of these newly added tags and attributes, the effect would have been a bunch of front-end programmers to write code to achieve, now the browser gave you realize well, just write two or three lines, call your browser to be able to get part of your implementation, simple and pleasant, so many people are enthusiastic to promote this standard (of course, the new standard can not be perfect, there will always be some problems, fear of beside the point here not press )

As for XHTML, HTML is a close relative of XML and HTML their hybrids, more stringent requirements for grammar, and for compatibility with XML, HTML syntax on a number of different ~

JavaScript and browser script
has been representing the content and semantic HTML, CSS provisions styles, get a static page, no animation (in fact, using CSS can still have some animation, but this is beside the point), press F5 will refresh the data, all the 21st century, such a dull monotone pages can show how creative I am eternally Hu mouth person race! So we have Javascript (JS) to add some dynamic effects to the page, such as the issue of peace known labels, hover will pop up a small window, the effect is JS achieve it.

The browser will help you achieve a number of tools you can use JS (functions, object or something), you just write some JS code stored in xxx.js years, html file with the

These are the contents of the front section, the following briefly what the back end of it> <

Web Server and Web Services
browser sends a request to the server, the server is not to see that how the response. The first of these requests and responses have a common wording, it is to have a protocol, the HTTP protocol is used.
Like Figure foremost, wrote a response from the server status code 200 OK, is a thing of the HTTP protocol in the convention, the server wrote 200 OK in the response, said, "Your request is this thing I have", if it is 404 Not Found is "you requested this thing I do not have."
HTTP response in also includes many things, such as Content-type representation of what the server sent me the file type (text? Animation? Pictures? Audio?), This issue is over people know how good the browser displayed to the user to see. People know how the server according to the agreement to write something into it, this is the Web Server to work right away.

Visualize what HTTP response, probably a long way:

Then the hammer, the process of requesting responses between the browser and the server is roughly this long, those things the lower right corner is generated by the Web Server (server script can do some changes, but these are generally live in the part of Web Server ):

Another example many times you visit a website, your browser's address did not specify the output file your request, such as address this problem is:
http://www.zhihu.com/question/22689579
but know almost Server in fact, a html returned to you, how do you know the address of the corresponding server to return what kind of html code to you? Web Server also doing live.

In addition to the browser address output hit enter this naked access, client and server interaction there are many, such as:
use of AJAX JS completed previously mentioned, a bit like a private message between the browser and the server -
as well as : interaction with other application server software, such as
interactive micro letter, QQ and Tencent server
online gaming company server and client interaction
interactive programs (crawlers) search engine used to collect information on the website with a variety of web servers
As long as you know what address to access, how to access other people's servers, and have the appropriate permissions, you can also write your own programs to a number of servers and their interaction (such as using the microblogging API - API Sina Weibo microblogging acquisition, third-party developers application or do data analysis).
As can be seen from these chestnuts, the main body of client and server interaction, object, the carrier is varied: the
server can be a mainframe can also be a PC, can run as long as the corresponding program line
client like chestnuts in front of the lift Like, it can be a variety of software, and the software may not run on a PC, can also be a mobile phone, tablet, smart wearable devices, and so
sometimes bring not already generated some good HTML or other files on the server, but transmission after a certain character string generated by logic or other types of data encapsulated
Like the previously mentioned HTML needs to have certain standards, like, in order to prevent confusion and speak the same language, we need to interact with some consensus on how these machines need, let them communicate. Communication between people, we need to have a written we all know (such as simplified / traditional) understand about each other and one language (such as in Mandarin / Cantonese). To make these kinds of machines able to interact through a network, we need to specify a protocol (such as HTTP / HTTPS) and one data encapsulation format (such as HTML / XML), Web Server provides Web Service, refers to this + exchange system protocol format. But the ecosystem and HTML Web Service standards are not the same, the user can select protocols and data encapsulation formats more, visit the website common use of HTTP + HTML is only one of some communication within a closed system can also define your own format and protocol to use (such as QQ).

Web Service data transmission again via a local client (browser, QQ / micro-channel, online games client, etc.) render the analysis, it can show up in the form of ordinary people can understand. There are also some Web Service is not designed for ordinary users, the microblogging API as previously mentioned, is used for secondary development program to ape the ~

In addition to providing Web Service, Web Server will also take into account a lot of functions, including providing caching, load balancing, so that access to a greater amount of time to have methodically pick up. Common ready-made Web Server has open-source Apache, Nginx and Microsoft's IIS, you can also use some tools (such as Node.js) own a custom. Because the Web Server requires good performance, so the Web Server used when production is usually C / C ++ / Java to write, but in fact can be written in many languages, and with the optimization model and good underlying language, written in other languages Web Server can also have a good performance.

PHP, server scripts, Web Framework
beginning of the picture is where you can send the file corresponding to the visitors after receiving the request to the server, but the server how the 21st century may only "access request - issued a document" so mentally it's a trick, people also you can handle the files you upload to the! It can also accept a variety of requests you sent me, to operate a local file server or database! To do these things, natural and ultimately have the server side code, the code is the server script. Data Web Service said earlier transmission, is largely generated by the server script, then by the Web Server, sets the overall response formatted according to some agreement, returned to the client.

With a web site, everyone can see the page is not necessarily the same, for example, know almost home page address is
http://www.zhihu.com/
But after landing and did not see things is not the same after landing, landing every personal user information to see the navigation bar, dynamic concern, not the same. Server scripts for these different states, generating different pages to the Web Server to return to the browser.
Know almost the whole html page to see all of it is about the same, there is a navigation bar on the left is a dynamic concern, the right advertising and sidebars, each piece of the overall structure similar, but in some places the contents differ. Server script is the use of known data, fill in the appropriate place in the content of these vary, generate page for everyone to see.
Such as my home page, to the right of the navigation bar to see the picture and the name is not the same with others, because this place has to put a picture [picture outside the chain dump failure (img-TyX1E3ng-1562223604560) ( )] label fill my avatar image links, tag fill in my name, and give them to fill the pages of other links, other names, so that everyone can see the page is not the same.

PHP is a common language used to write server scripts, in fact, as long as it can be used to write all data transmission Common Language Interface (CGI) can be used to write a server script (that is to say almost all programming languages ​​may be written = = b), only because of the richness and degree specializing in ready-made tool is not the same, so there are some language when writing server-side script would be more popular.

For convenience, we write server scripts, also typically treated with a same language used to write Web Framework variety of details, some of the common defense attacks, cross-site to provide authentication (such as registered to other sites with existing micro-blog account ) interface, using cookie handling and user log-in status, the generated web page template and the like. If you write a script server with C # or Visual Basic, you can use http://ASP.NET implement these features in this framework, to help save you some trouble. But now, many people turn to is a useful Web Framework to select its corresponding server scripting language.

A process common site visit
quick overview, for us ordinary Web site access, technology involved is this:
the user operates the browser access, the browser sends a HTTP request to the server;
the server receives the HTTP request, Web Server accordingly preliminary processing, use server script generate pages;
server script (using the Web Framework) and call the local data from the client, to generate the page;
Web server will generate pages as the body HTTP response HTTP header is generated based on the results of different treatments, hair back to the client;
the client (browser) receives the HTTP response, the HTTP response body first request is normally obtained in the HTML code, then begins to parse the HTML code;
resources on the server parsing encountered during references (additional CSS, JS code, images, audio and video, attachments, etc.), Web Server sends a request again, Web Server to find the corresponding file, sent back;
the browser parses the HTML contained, with the appearance of the CSS code to get further rendering, JS code may also be outside A certain process;
the user to interact with the page (click, hover, etc.), JS code is to make certain this reaction, add special effects and animation;
may need to request or submit additional data to the server in the process of interaction (local refresh similar micro-blog message notification), is generally not Skip by JS code (in response to an action or timing) sends a request to the Web server, Web server then server-based script (or write data to generate the processing resources ), and returns the resource to the client, the client with resources to achieve dynamic effects or other changes.
Note that this is just a small site in the more common model, in order to solve large-scale problems the site will have a lot of treatment, each session there will be some subtle differences, the middle will use a variety of tools to reduce the pressure on the server, improving efficiency to facilitate routine maintenance -

Further reading - those terms seeing things in
order to facilitate debugging, many Web Framework will be built a simple Web Server, Web Server or some will comes with a simple Web Framework, the actual deployment used to open on the server or the time for performance security and other aspects to consider, can be replaced by other built-in Web Server, such as Apache or Nginx (For chestnut, know almost use the Tornado do framework, Server replaced Nginx, know almost see what the use of the framework and open source library?). If something is open source, you can also Subject to the open source license and then change it yourself ~

Unlike the front because the back-end has HTML + CSS + JS facts established standards such as server scripts and Web Framework was good, so novices will hear a lot of technical terms and more dazzling place here - give some chestnuts, early common the server-side language are:
open source PHP
the Java Sun's JSP used in
VBScript Microsoft's ASP used in the
present application heat up in this regard languages are
Python, corresponding to the common Framework includes known peace and Quora helpful to Tornado (in fact, comes Framework, Web Server), the community is very mature Django (users, including Instagram, Pinterest) such as
Ruby, Rails usually use this Framework, users, including Github, Twitter and other early
Guards JavaScript, with Node. js this platform, Web server, server scripts and script all browsers can use JavaScript to write ...... on the Node.js Framework is the most commonly used Express
, Microsoft is home to follow http://ASP.NET transferred to the Basic C # or Visual
Erlang , specializes in large-scale concurrency, many game companies used to write server, rely on dozens of projects Teacher support hundreds of millions of users WhatsApp also used this -
several common architecture includes:
LAMP = Linux + Apache + MySQL + PHP (P may also be Python or Perl. Sometimes L will be changed to W = Windows.), Which is the operating system on the server is Linux, Web Server with Apache, a database with MySQL, server script PHP, these are open source technology, when the site started up with the cost will be relatively low, it is very common in the general site architecture (although for the development of very large sites will encounter a lot of bottlenecks), Facebook is this Taobao also used to be.
J2EE, Java world architecture, business is usually used (banks, large companies, .etc), but also more common to do with one kind of UNIX operating systems, Apache do Web Server, Tomcat JSP conversion to a Java server program to use ( In fact, it also comes with Web Server), Oracle databases, and so on. Not necessarily bring a station, often used to provide the enterprise need to use a variety of network services. Our school educational system is to use J2EE to do =. = Taobao is now in transition from LAMP to this.
http://ASP.NET , Microsoft's family of architecture, often with the Windows Server operating system, SQL Server database, IIS do Web Server. StackOverflow and Jingdong (once) is this architecture.
MEAN amazing architecture, MongoDB do database, Express do Web Framework, Angular JavaScript framework to make the front end, Node.js for writing Web Server. The magic thing is that these languages are JavaScript (MongoDB is not achieved, but the language of communication with the outside world is). Because it is relatively new architecture, as well as the test of time, but is deeply concerned about a lot of people (especially by eating JavaScript front-end program apes).
In general focus is not on technology but also care about the cost of the new site prefer to use LAMP, pay attention to security, stability and speed of enterprises and institutions like J2EE, I want to save the site like http://ASP.NET , compare Geek website and start-up companies like toss a variety of Python, Ruby, Node.js thing in the world, Google is so readily available technology can not solve the needs of very large sites to toss their own solutions.
Although you can use a wide variety of languages and system belongs, in fact, the essence of things to do server-side programs are similar, like the natural world to express "not eaten" what it means, you can use a variety language expressed in a variety of scenes -

Experience and feel
the front desk three, html is a noun, css adjective, javascript is a verb. Three complement each other is a sentence

Forget technology it, think about what technologies besides, the way you go if metaphysical tangle technology, will become a puppet technology, they are just an expression of metaphysical hope you can go look at technology, the ever-changing technology, but all It is the way to solve the problem. Ask yourself, what the problem is? How to solve, again arrange technology, and the technology of choice, the last often not the best, but you can be the fastest solution to the problem that often is that you are most familiar.


Author: tham_
Source: CSDN
Original: https://blog.csdn.net/tham_/article/details/44425087
Copyright: This article is a blogger original article, reproduced, please attach Bowen link!

Guess you like

Origin blog.csdn.net/PyhtonChen/article/details/94618601