简单的Javascript运行在客户端还是服务器端? [英] simple Javascript runs on clientside or serverside?

查看:663
本文介绍了简单的Javascript运行在客户端还是服务器端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

simple Javascript code runs at clientside or serverside?

推荐答案

通常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


这篇关于简单的Javascript运行在客户端还是服务器端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆