且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

简单的Javascript运行在客户端还是服务器端?

更新时间:2023-11-27 22:00:34

通常JS仅在客户端(浏览器)上运行.
开发人员还可以在JS上编写事件驱动的代码,这些代码可以在事件上执行某些功能,并可以在某些引擎(如V8)上运行
http://code.google.com/p/v8/ [ http://en.wikipedia.org/wiki/JavaScript [
normally JS runs on the client side(browsers) only.
Developer can also write event driven code on JS which can be execute some function on event and can be run on some engine like V8
http://code.google.com/p/v8/[^]

so there are some JS which we can say server side JS like node.js which using V8 engine(same engine use by chrome) for more reference :

http://en.wikipedia.org/wiki/JavaScript[^]


JavaScript代码仅在客户端运行.它主要用于验证客户端验证.

http://www.w3schools.com/js/default.asp [
Javascript code runs at clientside only. it mainly useful to validate client side validations.

http://www.w3schools.com/js/default.asp[^]


嘿阿蒂,

Javascript是一种解释性语言,它与HTML和CSS一起从服务器发出.它在客户端运行.
所有浏览器都具有可以理解该语言的功能.

HTML中的标记告诉浏览器,下一个statemenet是脚本代码,而不是普通HTML,直到命中为止.

有关更多详细信息,可以检查"Head First Javascript"或尝试 www.w3schools.com/js/default.asp [^ ]

希望有帮助.
Milind
Hey Aarti,

Javascript is kind of interpreted language, which is emited from server along with HTML and CSS. It runs on client side.
All browser has functionality by which it can understand the language.

tag in the HTML tells the browser that the next statemenet are script code rather than normal HTML until it hits .

For more details, you can check "Head First Javascript" or try www.w3schools.com/js/default.asp[^]

Hope that helps.
Milind