我可以创建什么(什么样的)项目来学习 JavaScript?
我不久前开始学习 JavaScript。考虑到我在大学学过 Java、非常了解 php 并且我已经使用过 python 和 ruby,这是一种相当简单的编程语言。问题是,为了正确学习编程语言,我通常会创建一个项目。在javascript中,我只是不知道我可以创建什么样的项目——也就是说,一个不基于网络或与网络浏览器相关的项目。我可以创建 javascript shell 脚本吗?除了网络浏览器之外,JavaScript 还常用在哪些地方?
那么,有人可以给我一些想法吗?
I started learning JavaScript a while ago. It's a fairly easy programming language considering that I learned Java in university, that I know php pretty well and that I already played around with python and ruby. The problem is that to properly learn a programming language I usually create a project. In javascript, I just don't know what kind of project I could create - that is, a project that is not web-based or related to the web browser. Can I create javascript shell scripts? Where is javascript commonly used beside the web browsers?
So, can someone actually give me some ideas please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
你打赌!
cscript.exe
来完成此操作(您甚至可以设置一个文件扩展名 - 我使用jx
- 当您双击时它会自动运行)单击文件名或将其用作 shell 中的命令:只需将该文件扩展名与命令关联起来"c:\WINDOWS\system32\cscript.exe" /e:JavaScript /nologo "%1" %*)。这(我仔细测量过)比使用 Windows 批处理语言要好大约 8000 万倍。关于。 (如果您不想使用 JScript——Microsoft 的 JavaScript 变体——您甚至可以选择,请参见下文。)
#!... 行告诉命令解释器)。我希望如果你四处寻找,你会找到一些。
/System/Library/ 中安装了 JavaScriptCore Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc
我用它在 Windows 上编写 shell 脚本。我还将它用作服务器端语言,例如在 Web 应用程序的服务器端部分。它还用于其他需要使用轻量级、功能强大的脚本语言的环境,例如 MongoDB< /a> shell环境(可以用它来查询MongoDB数据)和存储过程。
综上所述,编写基于浏览器的项目是学习该语言的一种丰富的交互式方式。
You bet!
cscript.exe
(you can even set up a file extension -- I usejx
-- that automatically runs when you just double-click the filename or use it as a command in a shell: Just associate that file extension with the command"c:\WINDOWS\system32\cscript.exe" /e:JavaScript /nologo "%1" %*
). This is (and I've measured carefully) about 80 milion times better than fighting with Windows' batch language. About. (And if you don't want to use JScript — Microsoft's variant of JavaScript — you even have options, see below.)#!...
line at the top is telling the command interpreter). I expect you'll find a few if you search around./System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc
I use it for shell scripting on Windows. I also use it as a server-side language, for instance in the server-side part of a web application. It's also used in other environments where a lightweight, powerful scripting language is useful, such as in the MongoDB shell environment (you can use it to query MongoDB data) and stored procedures.
All of that said, writing a browser-based project is a rich, interactive way to learn the language.
Windows 侧边栏小工具、Apple 的小部件和 Google 桌面小工具都是使用 HTML/JS/CSS 创建的。
我通过创建一些小型 Windows 侧边栏小工具来学习 Javascript。
入门
侧边栏参考
windows Sidebar Gadgets, Apple's Widgets, and Google Desktop Gadgets are all created using HTML/ JS/ CSS.
I learnt Javascript by creating a few small Windows Sidebar Gadgets.
Getting Started
Sidebar Reference
您可以使用 javascript 制作可以在 Web 浏览器沙箱之外运行的 HTA(HTML 应用程序)。
MSDN HTA 应用程序简介
HTML 应用程序的 Javascript 教程
You could use javascript to make HTA (HTML Applications) that can be run outside of the the web browser sandbox.
MSDN intro to HTA Applications
Javascript Tutorial on HTML Applications
您可以编写一个非阻塞 TCP 服务器。
Node.js 支持这一点。
You could write a non-blocking TCP server.
Node.js supports that.
浏览器之外 JavaScript 的常见用途是 Windows 上的 WSH 脚本和 HTA 应用程序以及 Mac 上的仪表板小部件。
Common uses of javascript outside of browsers are WSH scripts and HTA applications on Windows and Dashboard widgets on Mac.