简体   繁体   中英

Can I start with jQuery (or Node.js) with “NIL” knowledge of JavaScript?

[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}

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.

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.

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM