简体   繁体   English

什么是客户端javascript,什么是服务器javascript?

[英]What is client side javascript and what is server side javascript?

Will any one please explain me what is server side java script and client side java script 谁能解释一下什么是服务器端Java脚本和客户端Java脚本

Because I recently heard about livewire JavaScript is server side and navigator JavaScript is client-side. 因为我最近听说livewire JavaScript是服务器端的,而导航器JavaScript是客户端的。

Kindly any one explain me the difference. 有人可以解释我的区别。

There are 3 major types of JavaScript namely: JavaScript有3种主要类型:

  1. Client-Side JavaScript (CSJS) -- an extended version of JavaScript that enables the enhancement and manipulation of web pages and client browsers 客户端JavaScript(CSJS)-JavaScript的扩展版本,可增强和操纵网页和客户端浏览器

  2. Server-Side JavaScript (SSJS) -- an extended version of JavaScript that enables back-end access to databases, file systems, and servers 服务器端JavaScript(SSJS)-JavaScript的扩展版本,支持对数据库,文件系统和服务器的后端访问

  3. Core JavaScript -- the base JavaScript language 核心JavaScript-基本的JavaScript语言

Client-Side JavaScript (CSJS) and Server-Side JavaScript (SSJS) are dependent on the core JavaScript and cannot work without it. 客户端JavaScript(CSJS)和服务器端JavaScript(SSJS)依赖于核心JavaScript,没有它就无法工作。

Source 资源

For most part in the modern web, javascript is 99% times client side (yes I made up the statistic). 在现代网络中的大多数情况下,javascript是客户端的99%倍(是的,我做了统计)。

That said, javascript is just another language. 也就是说,javascript只是另一种语言。 Back in the olden days, there was the Netscape Enterprise Server ( NES it was called) which allowed scripting in javascript. 过去,Netscape Enterprise Server(简称NES )允许使用JavaScript编写脚本。

Modern web servers support scripting langauges like php, python etc. Its unfortunate that js is not big on the server side. 现代的Web服务器支持脚本语言,例如php,python等。不幸的是,js在服务器端并不大。 Its the single most beautiful language I've encountered: the syntax of C, with the power of something like Lisp. 它是我遇到过的最美丽的语言:C的语法,以及Lisp之类的功能。

The conventional client side usage of javascript alludes to its use in the web. javascript的常规客户端用法暗示了其在网络中的用法。 I'm sure you know all about javascript on the web (if you are intelligent enough to ask about ssjs). 我敢肯定,您对网络上的javascript一无所知(如果您足够聪明,可以询问ssjs)。

But some unconventional uses of javascript: 但是javascript的一些非常规用法:

  • However, Qt has found use for javascript in its framework. 但是,Qt在其框架中发现了javascript的用途。 Qt applications can be written to be extensible by addons written in javascript. Qt应用程序可以通过使用javascript编写的插件编写为可扩展的。 I think its pretty cool. 我认为它很酷。
  • There is also Rhino, that compiles javascript into Java. 还有Rhino,可将javascript编译为Java。

Cheers! 干杯!

One runs in the browser (client side), the other runs on the server . 一个在浏览器(客户端)中运行 ,另一个在服务器上运行 JavaScript is commonly believed just to run on browsers- this is incorrect. 通常认为JavaScript只能在浏览器上运行-这是不正确的。 When I was a classic ASP developer we had the choice of VBScript or JavaScript server side (we also had the choice of JavaScript or VBScript client side too). 当我是一名经典的ASP开发人员时,我们可以选择VBScript或JavaScript服务器端(我们也可以选择JavaScript或VBScript客户端端)。

These two terms are used in the context of web. 这两个术语在网络环境中使用。 Client-side means that the JavaScript code is run on the client machine, which is the browser. 客户端意味着JavaScript代码在客户端计算机(即浏览器)上运行。 Server-side JavaScript means that the code is run on the server which is serving web pages. 服务器端JavaScript意味着代码在提供网页的服务器上运行。

Client-side javascript allows you to make possible some user interactions, by for instance changing the DOM, adding events to html elements, etc.. 客户端javascript允许您通过更改DOM,向html元素添加事件等使某些用户交互成为可能。

On the other hand, server side javascript, allows to exploit the javascript in its entireness by building more scalable, event-driven and non I/O blocking applications. 另一方面,服务器端javascript可通过构建更具可伸缩性,事件驱动和非I / O阻止的应用程序来全面利用javascript。 One example of server side javascript environment is NodeJs. 服务器端JavaScript环境的一个示例是NodeJ。

Moreover, in this way the learning curve for both client and backend developers in learning javascript is diminished, since both talk the same language. 而且,这样,由于客户端和后端开发人员都使用相同的语言,因此它们在学习javascript时的学习曲线得以减少。

I believe there is no other popular language than javascript which fits exactly as the client side scripting language. 我相信除了JavaScript之外,没有其他流行语言能完全适合客户端脚本语言。 Coming to server side language similar to java(works on many servers but popularly apache tomcat),C# and python, javascript can also be used as Server side language best example is NodeJs(similarly Node also needs Node package to be installed on the server to run the script). 来到类似于Java的服务器端语言(可在许多服务器上运行,但普遍使用apache tomcat),C#和python,javascript也可以用作服务器端语言,最好的例子是NodeJs(类似,Node也需要在服务器上安装Node软件包)。运行脚本)。

for your question navigator being client side JS works on browser and Livewire works on server. 对于您的问题导航器,客户端JS可在浏览器上运行,而Livewire可在服务器上运行。

Netscape Navigator 2.0 (and later versions) can interpret JavaScript statements embedded in an HTML page. Netscape Navigator 2.0(及更高版本)可以解释HTML页面中嵌入的JavaScript语句。 When Navigator requests such a page, the server sends the full content of the document, including HTML and JavaScript statements, over the network to the client. 当Navigator请求此类页面时,服务器将通过网络将文档的完整内容(包括HTML和JavaScript语句)发送到客户端。 The Navigator then displays the HTML and executes the JavaScript, producing the results that the user sees. 然后,导航器显示HTML并执行JavaScript,产生用户看到的结果。

LiveWire is an application development environment that uses JavaScript for creating server-based applications similar to CGI (Common Gateway Interface) programs. LiveWire是一个应用程序开发环境,使用JavaScript创建类似于CGI(通用网关接口)程序的基于服务器的应用程序。 In contrast to Navigator JavaScript, LiveWire JavaScript applications are compiled into bytecode executable files. 与Navigator JavaScript相比,LiveWire JavaScript应用程序被编译为字节码可执行文件。 These application executables are run in concert with a Netscape server (version 2.0 and later) that contains the LiveWire server extension. 这些应用程序可执行文件与包含LiveWire服务器扩展名的Netscape服务器(2.0版及更高版本)一起运行。

Information source 信息来源

在此处输入图片说明

You may visit here for details :-) http://net-informations.com/js/iq/side.htm 您可以访问此处以获取详细信息:-) http://net-informations.com/js/iq/side.htm

Client side java script comprises the basic language and predefined objects which are relevant to running java script in a browser. 客户端Java脚本包括与在浏览器中运行Java脚本相关的基本语言和预定义对象。 The client side java script is embedded directly by in the HTML pages. 客户端Java脚本直接通过HTML页面嵌入。 This script is interpreted by the browser at run time. 该脚本由浏览器在运行时解释。

Server side java script also resembles like client side java script. 服务器端Java脚本也类似于客户端Java脚本。 It has relevant java script which is to run in a server. 它具有要在服务器中运行的相关Java脚本。 The server side java scripts are deployed only after compilation. 仅在编译后才部署服务器端Java脚本。 Server-Side JavaScript (SSJS) . 服务器端JavaScript(SSJS)。 It is JavaScript that enables back-end access to databases, file systems, and servers. 正是JavaScript使得能够后端访问数据库,文件系统和服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在客户端将服务器端变量传递给 JavaScript 的最佳方法是什么? - What is the best way to pass server side variables to JavaScript on the client side? 什么是 javascript 的服务器端渲染? - What is server side rendering of javascript? 客户端javascript或服务器端 - client side javascript or server side javascript-我的客户端选项是什么? - javascript - What are my client-side options? 什么是客户端MVC以及如何在JavaScript中实现? - What is client side MVC and how is it implemented in JavaScript? 通过ajax调用传递的javascript对象(使用JSON序列化的客户端)的服务器端类型是什么? - What is the server side type of a javascript object, serialised client side using JSON, that is passed via an ajax call? 将客户端javascript中的数组或哈希传递给服务器端ruby的好方法是什么? - What are good ways of passing an array or hash in client side javascript to server side ruby? 服务器端 javascript 的主要优势是什么? - what is the main advantage of server-side javascript? 什么是服务器端javascript等效于xpath的xpath - What is the server side javascript equivilant to xpath for xquery 服务器端和客户端JavaScript - Server-side and client-side JavaScript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM