我可以从 jQuery(或 Node.js)开始使用“NIL”吗?了解 JavaScript 吗?

发布于 2024-12-11 07:19:19 字数 1418 浏览 0 评论 0原文

[披露:这个问题与 我之前的问题。]

正如你所看到的,一些人建议我学习 JavaScript / jQuery / Node.js。据我所知,(a) jQuery 是一个 JS 库,它使 JavaScript 编码(一次性跨所有浏览器工作)变得更容易,(b) Node.js 基本上是一个服务器端 JavaScript 环境,(c ) Javascript 是上述语言的根编程语言,并且是客户端的。

我也读过很多关于SO的相同问题,但是对于像我这样对任何类型的编程都一无所知的人来说,有些事情还不清楚。

(1) 基本上,我的目标是为我的博客编写一个(实时)实时博客/评论应用程序。据我所知,这需要像 JavaScript 这样的客户端脚本语言。所以,问题是,我可以仅使用 (a) jQuery (b) Node.js 构建这样的应用程序吗?

(2) 如果 (1) 的答案是肯定:您认为使用服务器端选项 - - Node.js 会更好吗? (因为 jQuery 肯定不能在禁用 JS 的浏览器上工作,我不了解 Node.js。)请指教。

(3) 当我得到一本关于XHTML的书时,这本书让我开始接触HTML,并逐渐带我进入XHTML。因此,HTML 和 XHTML 之间并不存在混淆。 (a) jQuery 和 (b) Node.js 也会出现这种情况吗?

编辑: (4) JS 有一个问题。有些用户可能在浏览器中禁用了 JS。有没有像 JS 一样好的客户端脚本替代方案? (只是问)

也就是说,为了学习,我应该先学习(a)jQuery 或(b)Node.js,JS 还是我可以立即从初学者的 jQuery 或 Node.js 书开始?哪一个是正确的方法?

我真的需要你的建议,因为我对编程完全陌生(并且几乎没有时间学习),并且我对未来感到非常兴奋。

(我尽可能使用 (a) jQuery(b) Node.js 来表示您单独考虑它们,并且不认为我会同时学习两者.我只能选择一个,至少现在是这样。)谢谢。

决定!决定!对于将来可能来这里寻找相同东西的人...从答案中很明显,人们可以从 jQuery 开始,并最终通过实践学习纯 JS(构建应用程序、解决问题等) 。看来学习曲线这样会更长?! (因为你最终会遇到问题,继续尝试解决它们,也许会失去信心......等等!等等!等等!)但这很好。我选择的是直接的方式 - 首先使用 JS(直到我觉得我已经掌握了一些),然后再使用 jQuery!我希望我的结论没有错。 :) {感谢@Greg Pettit 和@Pete Wilson}

[Disclosure: This question is slightly related to my previous question.]

As you can see, a few suggested that I learn JavaScript / jQuery / Node.js. From what I've read, (a) jQuery is a JS library that makes coding in JavaScript (that works across all browsers in one go) easier, (b) Node.js is a basically a server-side JavaScript environment, (c) Javascript is the root programming language of the aforementioned ones, and is client-side.

I have also read many questions regarding the same on SO, but for someone (like me) who has nil knowledge of any kind of programming, somethings aren't clear.

(1) Basically, my goal is to write a (real-time) live blogging/commenting application for my blog. This, I have learnt, requires a client-side scripting language like JavaScript. So, the question is, can I build such an application with (a) jQuery alone (b) Node.js alone?

(2) If the answer to (1) is YES: Do you think going with the server-side option - - Node.js would be better? (as jQuery definitely doesn't work on JS-disabled browsers, I don't know about Node.js.) Please advise.

(3) When I got a book for XHTML, the book got me started with HTML, and gradually took me into XHTML. So, there was no confusion between HTML and XHTML. Would that be the case with (a) jQuery and (b) Node.js too?

EDIT: (4) There's one problem with JS. Some users may have JS disabled in the browser. Is there any other client-side scripting alternative as good as JS? (Just asking)

That is, in order to learn, (a) jQuery or (b) Node.js should I first learn, JS or can I start with a beginner's jQuery or Node.js book right away? Which would be the right way?

I really need your advise here, as I am totally new to programming (and have very little time to study), and I am pretty excited of what's ahead.

(I used (a) jQuery and (b) Node.js whenever possible to denote that you consider them separately, and not think that I will be learning both. I can only choose one, at least for now.) Thanks.

DECISIONS! DECISIONS! For someone who may come here in the future searching for the same... From the answers it's clear that one can start with jQuery, and end up learning pure JS through practice (building applications, solving issues etc). It seems the learning curve, that way, would be longer?! (Because you end up having problems, keep trying to solve them, maybe lose confidence... blah! blah! blah!) Still that's good. What I've chosen is the straight forward way - JS first (until I feel like I've got some hold), and then go go jQuerying! I hope I am not wrong in my conclusion. :) {Thanks @Greg Pettit and @Pete Wilson}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

烂人 2024-12-18 07:19:19

Node.js 和 jQuery 扮演两个不同的角色。一个促进服务器端 JavaScript,另一个为客户端 JavaScript 提供抽象库。这不是一个或另一个。这个问题必须分为两个方向:

  1. 我想使用什么服务器端技术? PHP+MySQL(一种已知的商品)会在服务器端做我想做的事情吗?我应该使用我已经熟悉的东西(ASP 或其他)吗?或者我是否喜欢 Node.js 的预期性能优势和可扩展性来参与其中? Node.js 是否拥有足够成熟的数据库类来实际将其用于我的目的?

  2. 在客户端,我想用“纯”JavaScript 编写所有内容,还是想使用框架?如果我使用一个框架,我应该使用 jQuery,因为它似乎是最广为人知的,还是我应该研究其他可能实现我想要的功能的框架?此外,我应该研究 Kendo UI 或 jQuery UI 这样的 Web 应用程序框架,还是将其与 JavaScript 框架拼凑在一起?

在某些时候,如果你根本不懂 JavaScript,有人会告诉你,你应该从纯 JavaScript 开始,这样框架就不会腐蚀你。我,我说呸。你想要把事情做好。当你本可以完成工作时,你不想把时间花在跳过圈子上。

如果您直接跳入框架(例如 jQuery)而不是正确学习 JavaScript,那么无论如何您最终都会学到一些东西。不久之后,您就会意识到,当您可以只使用 this.id 时,您不需要使用 $(this).attr('id') 。但这并不重要,因为前者一直有效,直到您学会更好的方法为止。

我以前是一名教育家,非常支持快速看到结果,因为这会促使你学习更多。仅仅因为您从 jQuery 开始并不意味着您将永远忽略“纯”JavaScript。如果您是一个聪明的解决问题的人,最终“纯”JavaScript 会找到您,您将开始确定使用它的正确时机以及使用框架的正确时机。

Node.js and jQuery perform two different roles. One facilitates server-side JavaScript, the other provides an abstraction library for client-side JavaScript. It's not one or the other. The question has to be branched into two directions:

  1. What server-side technologies do I want to use? Is PHP+MySQL (a known commodity) going to do what I want on the server side? Should I use something I'm already familiar with (ASP or whatever)? Or do I like the projected performance benefits and scalability of Node.js to jump into that? Does Node.js have mature enough Database classes to actually use it for my purpose?

  2. On the client-side, do I want to write everything with 'pure' JavaScript, or do I want to use a framework? If I use a framework, should I use jQuery because it seems to be the most widely-known, or do I research other frameworks that might do what I want? Furthermore, should I look into web application frameworks like Kendo UI or jQuery UI or piece it together with a JavaScript framework?

At some point, someone is going to tell you if you don't know JavaScript at all that you should start with pure JavaScript so that frameworks don't corrupt you. Me, I say phooey. You want to get stuff done. You don't want to spend your hours jumping through hoops when you could be just getting stuff done.

If you jump right into a framework (say, jQuery) instead of learning JavaScript properly, there are things that you will learn eventually anyhow. Before too long you'll realize that you didn't need to use $(this).attr('id') when you could've just used this.id. But it doesn't matter, because the former worked until you learned the better way.

I'm a former educator and very much in support of seeing results quickly, because it will propel you to learn more. Just because you start with jQuery doesn't mean you'll forever ignore 'pure' JavaScript. If you are an intelligent problem-solving kind of person, eventually 'pure' JavaScript will find you, and you'll begin to identify the right time to use it, and the right time to use a framework.

念三年u 2024-12-18 07:19:19

你绝对应该先从学习 Javascript 开始。我首先会阅读Eloquent Javascript来学习JavaScript。然后,学习 jQuery,然后学习 Node.js。对于 jQuery,我建议您应该阅读 jQuery in Action 来学习 jQuery。

You should definitely start with learning Javascript first. I would read Eloquent Javascript to learn javascript at first. Then, learn jQuery and then node.js. For jQuery, I would say you should read jQuery in Action to learn jQuery.

仅冇旳回忆 2024-12-18 07:19:19

对于大多数 Web 应用程序,您需要服务器端部分。对于您想要执行的应用程序,您需要客户端 Javascript。你必须完成这两部分。

对于服务器端部分,您可以使用任何您喜欢的东西,无论是 Node.js,还是 PHP + 无数的 PHP Web 框架,或者任何其他可以响应 HTTP 请求的东西。

Node.js 和 jQuery 服务于完全不同的目的,您不太可能找到一本同时涉及这两种内容的书,即使找到了,我可以想象这些主题之间也没有“平滑”的进展。

jQuery 确实利用了 Javascript 的某些特性(重新绑定 this),它的一些重要功能(匿名函数),并在顶部引入了几种模式(使用文字对象作为命名/可选函数参数),所以我建议您研究中等高级水平的 JS,而不要只是混日子。

For most web-applications, you need a server-side part. For the application you want to do, you need client-side Javascript. You'll have to do both parts.

For the server-side part, you can use whatever you please, whether it's Node.js, or PHP + the myriad PHP web frameworks, or anything else that can respond to HTTP requests.

Node.js and jQuery serve completely different purposes, it's unlikely you'll find a book that deals with both, and if you do, there's no "smooth" progression between the topics I can imagine.

jQuery does make use of certain idiosyncracies of Javascript (rebinding this), some of its nontrivial features (anonymous functions), and introduces several patterns on top (using literal objects for named/optional function arguments), so I'd recommend looking into JS at the moderately advanced level rather than just muddling though.

与往事干杯 2024-12-18 07:19:19

你应该阅读 Douglas Crockford 的 javascript the good parts,用纯 Node.js 创建一个 hello world,然后使用express.js + socket.io 或 now.js。和 mongodb 进行数据持久化

You should read javascript the good parts by Douglas Crockford, make a hello world with pure node.js then use express.js + socket.io or now.js. and mongodb for data persistence

゛清羽墨安 2024-12-18 07:19:19

不用说,学习任何语言的库都需要先学习语言。但是你想如何学习它是你的选择,有些人喜欢先从库开始,然后自下而上遍历以覆盖语言的基础知识,而另一些人则喜欢在尝试高级语法之前先了解语言的基础知识和图书馆。
除此之外,我还应该提到 jQuery 和 Node.js 是完全不同的东西,并且也有不同的学习曲线。
Node.js 更多的是一个使 javascript 在服务器端运行并内置异步编程的概念。要学习 Node,您将学习一些服务器级 API,例如文件流、日志记录、文件系统操作、回调等,这些通常是服务器级任务。
而学习 jQuery,您将学习 javascript 如何在网页上操作 dom 和事件、css、ajax 等,以动态地更改这些页面。

从应用程序/网站构建的角度来看,我想说,要开始使用,您需要对 Nodejs 知之甚少,但对 JQuery 有更多了解。

PS:如果你想在 2017 年建立一个网站,我建议完全避免使用 jQuery,而选择像 Angular/React 这样的客户端框架。

Well it goes without saying to learn library of any language you need to learn the laguage first. But how you want to learn it is your choice, some people prefer to start with the library first then traverse bottom up to cover the basics of the language, while some other likes to get their hands dirty with basics of language before trying out advanced syntaxes and libraries.
To add to it I should also mention jQuery and Node.js are totally different things and have different learning curve too.
Node.js is more of a concept to enable javascript run at server side with asynchronus programming inbuilt. To learn node you will be learning some server level APIs like file streaming, logging, file system operations, callback etc which are typically server level tasks.
Whereas to learn jQuery you would learn how javascript operate of doms and events, css , ajax etc on a webpage to alter those pages dynamically.

From application/website building point of view I would say to get started you need very little knowledge of nodejs but more knowledge of JQuery.

PS: If you are looking to build an website today in 2017 I would suggest to avoid jQuery altogether and go for client frameworks like angular/react.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文