javascript 客户端脚本和服务器端脚本语言
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15270648/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Client side scripting and Server side scripting languages
提问by Rachel
What scripting languages comes under client side and what and all comes under server side?
If JavaScript is scripting language, then what about jquery. jquery is nothing but javascript library rite? so jquery is client side scripting?
I goggled it, but its still confusing. In some sites its given, client side scripting are JavaScript and vb script and in some other sites its saying only JavaScript. In case of server side, they are mentioning html also.
Can i have a clear idea about this.
客户端下有哪些脚本语言,服务器端下有什么?
如果 JavaScript 是脚本语言,那么 jquery 呢?jquery 只不过是 javascript 库仪式?所以 jquery 是客户端脚本吗?
我用护目镜检查它,但它仍然令人困惑。在某些站点中,客户端脚本是 JavaScript 和 vb 脚本,而在其他一些站点中,它只说 JavaScript。在服务器端的情况下,他们也提到了 html。
我能对此有一个清楚的想法吗?
回答by Subir Kumar Sao
Client Side:
客户端:
Scripts that execute in client side. In context of websites, it is scripts that execute in the browser of the user.
在客户端执行的脚本。在网站上下文中,它是在用户浏览器中执行的脚本。
Eg: Javascript, VB etc.
例如:Javascript、VB 等。
(JQuery, DOJO are libraries build on top of Javascript so it is also client side.)
(JQuery、DOJO 是建立在 Javascript 之上的库,因此它也是客户端。)
Server Side:
服务器端:
Scripts that execute in the Server. In context of website, it is scripts that execute on application servers.
在服务器中执行的脚本。在网站的上下文中,它是在应用程序服务器上执行的脚本。
Eg: PHP, Python, Ruby etc
例如:PHP、Python、Ruby 等
We cannot classify languages as client side or server side. There could be a scenario where a server can execute Javascript and render HTML from it. In this context Javascript becomes a server side lanuage. I hope I did not confuse you.
我们不能将语言分类为客户端或服务器端。可能存在服务器可以执行 Javascript 并从中呈现 HTML 的情况。在这种情况下,Javascript 成为服务器端语言。我希望我没有让你感到困惑。
回答by Quentin
What scripting languages comes under client side
客户端下有哪些脚本语言
For all practical purposes: JavaScript
出于所有实际目的:JavaScript
and what and all comes under server side?
什么和一切都在服务器端?
Every programming language under the sun (including JavaScript)
太阳底下的每一种编程语言(包括 JavaScript)
If JavaScript is scripting language, then what about jquery. jquery is nothing but javascript library rite? so jquery is client side scripting?
如果 JavaScript 是脚本语言,那么 jquery 呢?jquery 只不过是 javascript 库仪式?所以 jquery 是客户端脚本吗?
It is a library. Yes. Generally … it is geared very heavily towards the browser, but (in theory at least) you could use it with something like PhantomJS for manipulating webpages on the server.
它是一个图书馆。是的。一般来说......它非常适合浏览器,但是(至少在理论上)你可以将它与 PhantomJS 之类的东西一起使用来操作服务器上的网页。
I goggled it, but its still confusing. In some sites its given, client side scripting are JavaScript and vb script and in some other sites its saying only JavaScript. In case of server side, they are mentioning html also.
我用护目镜检查它,但它仍然令人困惑。在某些站点中,客户端脚本是 JavaScript 和 vb 脚本,而在其他一些站点中,它只说 JavaScript。在服务器端的情况下,他们也提到了 html。
Internet Explorer (although prossibly only older versions) also supports VBScript for client side programming. Using it isn't practical on the WWW since it doesn't run anywhere else.
Internet Explorer(虽然可能只是旧版本)也支持 VBScript 进行客户端编程。在 WWW 上使用它是不切实际的,因为它不能在其他任何地方运行。
回答by Jinzuuu
Quoted with minor formatting changes from user61852's answer
引用来自user61852 的答案的微小格式更改
"Here I will talk only about web programming.
“在这里我将只讨论网络编程。
Client side programminghas mostly to do with the user interface, with which the user interacts. In web developing it's the browser, in the user's machine, that runs this code, and is mainly done in javascript, flash, etc. This code must run in a variety of browsers.
客户端编程主要与用户交互的用户界面有关。在web开发中,运行这段代码的是浏览器,在用户的机器上,主要是在javascript、flash等中完成。这段代码必须在各种浏览器上运行。
Its main tasks are:
它的主要任务是:
validating input animation manipulating UI elements applying styles some calculations are done when you don't want the page to refresh so often The person in charge of front end programming must know:
验证输入动画 操作 UI 元素 应用样式 当您不希望页面经常刷新时,会进行一些计算 前端编程的负责人必须知道:
javascript css HTML basic graphic design Ajax maybe Flash some 3rd party javascript libraries like JQuery UI design information design, etc.
javascript css HTML 基本图形设计 Ajax 可能 Flash 一些 3rd 方 javascript 库,如 JQuery UI 设计信息设计等。
Server side programminghas to do with generating dynamic content. It runs on servers. Many of these servers are "headless". Most web pages are not static, they search a database in order to show the user updated personalized information. This sides interacts with the back end, like say, the database.
服务器端编程与生成动态内容有关。它在服务器上运行。许多这些服务器是“无头的”。大多数网页不是静态的,它们搜索数据库以向用户显示更新的个性化信息。这方面与后端交互,比如数据库。
This programming can be done in a lot of languages:
这种编程可以用多种语言完成:
PHP Java and jsp asp Perl Python Ruby on Rails, etc. This code has to do which:
PHP Java 和 jsp asp Perl Python Ruby on Rails 等。此代码必须执行以下操作:
Querying the database Encode the data into html Insert and update information onto the database Business rules and calculations The person in charge of server side programing must know:
查询数据库 将数据编码为 html 将信息插入并更新到数据库中 业务规则和计算 负责服务器端编程的人员必须知道:
some of the languages mentioned above HTML SQL, linux/unix shell scripting OOP business rules, etc."
上面提到的一些语言 HTML SQL、linux/unix shell 脚本 OOP 业务规则等。”
回答by JanTheHuman
If the code is compiled/run on the clients machine, it is considered client-side. Serverside means a script which is compiled/run on the server before sending it to a browser. jQuery is just a library for JavaScript. That's all clientside.
如果代码在客户端机器上编译/运行,则被视为客户端。服务器端是指在将其发送到浏览器之前在服务器上编译/运行的脚本。jQuery 只是一个 JavaScript 库。这都是客户端。
For instance, some common used languages on the web.
例如,网络上的一些常用语言。
Client-side: JavaScript
Server-side: PHP, Ruby, Perl
客户端:JavaScript
服务器端:PHP、Ruby、Perl
回答by chirag
In Client side scripting,Script file usually download on client system and client browser compiled this script file and generate HTML. And Generated HTML display by browser.
在客户端脚本中,脚本文件通常下载到客户端系统和客户端浏览器编译这个脚本文件并生成 HTML。并由浏览器生成 HTML 显示。
EX- JavaScript file, Jquery file, AngularJs file.
EX- JavaScript 文件、Jquery 文件、AngularJs 文件。
In server side scripting, when user request page for display then script run on server and generate dynamic HTMl file and send this HTML file to user.
在服务器端脚本中,当用户请求显示页面时,脚本在服务器上运行并生成动态 HTMl 文件并将此 HTML 文件发送给用户。
EX- Asp(.asp), Asp.Net(.aspx), PHP(*.php).
EX- Asp( .asp)、Asp.Net(.aspx)、PHP(*.php)。
回答by karthick
Please go through the below link
请通过以下链接
for client side programming and server side programming
用于客户端编程和服务器端编程
As for client side scripting and server side scripting. I think if you go through all the answers for this question you will get a clear idea.
至于客户端脚本和服务器端脚本。我想如果你把这个问题的所有答案都看完了,你就会有一个清晰的想法。
jQuery is a framework that uses JavaScript internally.
jQuery 是一个内部使用 JavaScript 的框架。
回答by Rina
Javascript isn't just a client-side scripting language. It is extensively used for it. But it ain't its only use. Its just the way we use Javascript to implement our functionality. Its a misconception that Javascript is used only for client-side scripting.
Javascript 不仅仅是一种客户端脚本语言。它被广泛用于它。但这不是它唯一的用途。它只是我们使用 Javascript 来实现我们的功能的方式。认为 Javascript 仅用于客户端脚本是一种误解。