Talking about server-side script and client script

Source: Internet
Author: User

ASP. NET is a server-side scripting technology that can be executed by an Internet server in a script embedded in a Web page. So before I learn asp.net programming, I think we need to look at scripting techniques. So what exactly is a script?

One, what is script, scripting language.

scripts are executable files that are written in a specific descriptive language, in a certain format, and are called macros or batch files. In layman's terms, a script is a collection of commands such as Bind and Alias, and as a general program, a script can assign a value to a variable, command the Web server to send a value to the client browser, and define a sequence of commands as a process. The collection can be stored in a separate file and then executed when needed, to facilitate CS use.

scripting language: A special language between HTML and programming languages such as JAVA, Visual Basic, and C + +, although it is closer to the latter, it does not have complex, rigorous syntax and rules for programming languages.

second, the role of script

scripts can usually be called and executed temporarily by the application. All kinds of scripts are now widely used in web design, because the script can not only reduce the size of the page and improve the speed of web browsing, but also can enrich the performance of the page, such as animation, sound and so on.


third, the classification of the script:



Both client and server-side scripting have their advantages and disadvantages:

1. Client Script

when a client sends an HTTP request through a client browser, the Web server returns the portion of the HTML document and the script part to the client browser, interprets the execution in the client browser, and updates the page in a timely manner, and the script processing is done in the client browser.

Advantages: Reduce server load while increasing the response speed of the page.

Disadvantages: Browser differences cause page differences

languages Supported: JavaScript JScript VBScript


2. Server-side scripting

when a user sends an HTTP request through a browser, the Web server runs the script and returns the results of the run to the HTML of the Web page to the client browser, which is all done on the server side.

Advantages: Reduce the operating results of the browser, improve the stability of the page.

disadvantage: Increased server load, while client response speed is slow.

supported languages: PHP, JSP, ASP, asp.net


Third, contact

server scripts are used to submit and process forms to implement dynamic content. The server script abstracts the underlying logic, making the framework the same, but the pages with different content are integrated. The most important thing is to separate the logical processing from the data. And usually the server's data are stored in the database, each time is the need for a database link, often the database connection is more time-consuming than the data query. To avoid this, web designers can abstract simple logic, such as a one-time read into the data, and then put the data into the client. So the next time we don't have to re-establish the connection, we can get the data from our own machine. There is no need for server frequent communication at all.

from this, their differences are obvious, server script running on the server, you can never see the content of the server, only the script interpreter sent back the HTML code, the browser to his overall reception, the client out of the server running, not directly perform database operations, he implemented the client simple logic.

The purpose of client-side scripting is obvious, avoiding redundant links and easing server pressure (no need to query the database multiple times).

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.