MENU service case
 Website construction website design Beijing website construction high-end website production company Shangpin China
We create by embracing change
360 ° brand value__
simplified Chinese character
Simplified Chinese English

Shangpin China Joins Hands with Beisheng Internet to Create a New Chapter in Website Construction

Type: Shangpin Dynamic Learn more

Script running platform

Source: Shangpin China | Type: website encyclopedia | Time: June 27, 2014
1、 Run script on client

You can run scripts on both the client side and the server side, and it is easy to distinguish the completely different operations of client script and server script. Client script is a script program running on the client. Its running environment is the Web browser of the client; The server-side script is a script program running on the server computer in the Web server software environment. The answer to the question of whether to run the script on the client or the server is different for each script, Website construction It also depends on some basic factors. Most of the programs written so far may have an implicit assumption that every line of code in the program runs on the same computer. If the script is run on two different computers, the Web application cannot be implemented on a single processor. No doubt, multiple processors can complete the task of the program at the same time, which will bring higher efficiency.

 
 Script Run

So what determines which computer runs a particular script? One of the main principles is that if the script can be run in the client, it should be completed by the client. Because both the client computer and the server have to pay for the calculation performed on the Web server. On the other hand, if the computing task is completed on the client computer, neither the client nor the server needs to spend too much. Based on this economic consideration, every task that can be downloaded to the client computer for completion should be completed by the client.

For example, in the authentication example, the verification of whether the person filled in the form conforms to the restriction rules is completed before the data in the form is sent to the server. It can be imagined that if 100 users submit the information filled in the form to the server at the same time, if they are not on the client side but on the server side, the computing time scattered on 100 client computers will be much less. Both the client and the server side are willing to adopt this method. If a task can only be completed on the client side, it must be completed by client script. This principle is obvious. Generally speaking, scripts that can only be completed on the client side refer to those scripts that use intrinsic objects that only exist in the client browser. For example, the object used to control the window or document viewed by the user. Other scripts may run on both the client side and the server side, so you can follow this principle to decide where to run the script.

2、 Running scripts on the server side

To complete a task using the server script, consider how to make the Web application respond as quickly as possible. The Internet connection between the client and server computers is usually a narrow channel. If using client script to complete a task means that the channel is filled with a lot of data, but only saves a little computing time of Web_Server, the response speed of Web applications will be very slow. For example, when it is necessary to collect information from a large database, Although the client script can also operate a database and collect information, it is better to use the server script, because only the critical and necessary information can be transmitted to the client through the HTTP connection.

If a task can only be completed on the server side, the server script must be used to complete it. If a task requires built-in objects, the task can only be completed on the server side, because built-in objects only exist on the server side. A built-in object that only exists in the server environment, such as a Session object, is a data object that can store information about a user session (II. ion). As long as you are still using a page in your Web application, you can permanently retain this information. For example, you can use the Session II object to provide users with a feature similar to the "shopping cart". If the Web application provides a shopping place to the client. Save the Session object on Service 3. At some time, the client can get a special page that lists all the selected objects. There are also security considerations when using server-side scripts. Sometimes, you may not want to disclose script code. If you embed client script in HT-ML documents, all visitors can see it, while using server-side script, you can use those scripts that need to be kept confidential as server-side scripts; Stored on the web server.

In addition, sometimes the script code may contain key information about the Web application. If someone steals this information, it may attack the Web site. For example, if the computer name and database name of the credit card database are disclosed, the database server will become an obvious target of external attacks, and the blade 9 is very dangerous. Any client-side script can be viewed and analyzed by others, and server-side script is safe enough in this regard. The final factor in considering where to run the script is the difficulty of the task. Generally, the client system is much smaller and slower than the server system. Therefore, when using client script, consider whether the task can be completed by the client system in a tolerable time. For example, it is better not to let the client end system complete the task that can only be completed using complex AI technology, because this task is likely to slow the running speed of the client computer, and will not affect the server

The script used to complete a complex task may contain a large amount of code, which means that a large amount of additional text code will be transmitted to the client through the Internet.
Source Statement: This article is original or edited by Shangpin China's editors. If it needs to be reproduced, please indicate that it is from Shangpin China. The above contents (including pictures and words) are from the Internet. If there is any infringement, please contact us in time (010-60259772).
TAG label:

What if your website can increase the number of conversions and improve customer satisfaction?

Make an appointment with a professional consultant to communicate!

* Shangpin professional consultant will contact you as soon as possible

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]

Communicate with professional consultants now!

  • National Service Hotline

    400-700-4979

  • Beijing Service Hotline

    010-60259772

Please be assured to fill in the information protection
Online consultation

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]