Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
276 views
in Technique[技术] by (71.8m points)

javascript - 什么是VanillaJS?(What is VanillaJS?)

I have one simple question, that got stuck in my mind for a few days: What is VanillaJS?(我有一个简单的问题,在我的脑海里停留了几天:什么是VanillaJS?)

Some people refer to it as a framework, you can download a library from the official pages.(有些人将其称为框架,您可以从官方页面下载库。) But when I check some examples or TodoMVC, they just use classic raw JavaScript functions without even including the library from the official pages or anything.(但是,当我查看一些示例或TodoMVC时,他们只使用经典的原始JavaScript函数,甚至不包括官方页面中的库或任何东西。) Also the link "Docs" on the official webpage leads to the Mozilla specification of JavaScript.(此外,官方网页上的“文档”链接也会导致JavaScript的Mozilla规范。) My question is: Is VanillaJS raw JavaScript?(我的问题是:VanillaJS是原始JavaScript吗?) And if yes, why people refer to it as "framework" when all you need is a browser without any special included scripts?(如果是的话,当你需要的是没有任何特殊包含脚本的浏览器时,为什么人们将它称为“框架”?) I am sorry for a probably stupid question but I have no idea what people are talking about when they say "VanillaJS".(对于一个可能很愚蠢的问题我很抱歉,但当他们说“VanillaJS”时我不知道人们在谈论什么。)   ask by user1377911 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is VanillaJS (unmodified):(这是VanillaJS(未经修改):)

// VanillaJS v1.0 // Released into the Public Domain // Your code goes here: As you can see, it's not really a framework or a library.(如您所见,它不是真正的框架或库。) It's just a running gag for framework-loving bosses or people who think you NEED to use a JS framework.(对于喜欢框架的老板或者认为你需要使用JS框架的人来说,这只是一个运行的插科打..) It means you just use whatever your (for you own sake: non-legacy) browser gives you (using Vanilla JS when working with legacy browsers is a bad idea).(这意味着你只需使用任何你的(为了你自己的缘故:非遗留)浏览器给你(使用Vanilla JS时,使用传统浏览器是一个坏主意)。)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...