📜  服务器端脚本和客户端脚本之间的区别

📅  最后修改于: 2021-09-10 03:04:41             🧑  作者: Mango

1. 客户端脚本:
Web 浏览器执行客户端脚本。当浏览器拥有所有代码时使用它。源代码用于通过 Internet 从 Web 服务器传输到用户计算机并直接在浏览器上运行。它还用于用户事件的验证和功能。

它允许更多的交互性。它通常会执行多个操作而无需用户。它基本上不能用于连接到 Web 服务器上的数据库。这些脚本无法访问驻留在 Web 浏览器中的文件系统。页面会根据用户的选择进行更改。它还可以用来创建在用户计算机上存储数据的“cookies”。

2.服务器端脚本:
Web 服务器用于执行服务器端脚本。它们基本上用于创建动态页面。它还可以访问驻留在 Web 服务器上的文件系统。在脚本语言上运行的服务器端环境是 Web 服务器。

脚本可以用许多可用的服务器端脚本语言中的任何一种来编写。它用于为动态页面检索和生成内容。它用于要求下载插件。在这种情况下,加载时间通常比客户端脚本更快。当您需要存储和检索信息时,将使用数据库来包含数据。它可以使用大量的服务器资源。它减少了客户端计算开销。服务器向用户/客户端的请求发送页面。

客户端脚本和服务器端脚本之间的区别:

Client side scripting

Server side scripting

Source code is visible to user. Source code is not visible to user because it’s output 
of server side is a HTML page. 
 
It usually depends on browser and it’s version. In this any server side technology can be use and it does not 
depend on client. 
 
It runs on user’s computer. It runs on web server.
There are many advantages link with this like faster. 
response times, a more interactive application. 
 
The primary advantage is it’s ability to highly customize, response 
requirements, access rights based on user. 
 
It does not provide security for data. It provides more security for data.
It is a technique use in web development in which scripts runs on clients browser. It is a technique that uses scripts on web server to produce a response that is customized for each clients request.
HTML, CSS and javascript are used. PHP, Python, Java, Ruby are used.