Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How necessary is it to learn JavaScript before jQuery?

I've been working as a back-end web developer for the last 2 years but since the beginning of this year, i'm starting to see i have some very good skills for front-end web development as well.

Still, i only have solid knowledge of HTML/XHTML and CSS 2/3.

I actually can write some small inline JavaScript snippets already, but i feel like i still need more deep study on this matter. That desire made me meet good JS libraries like jQuery, which seems to fit the best for my needings right now.

So, a doubt was created in my mind, and i'd love if i could get a hint of more experienced front-end devs:

Where to start from? The good ol' classic JavaScript, or start from a library already, like jQuery?

Thanks in advance for all the tips =)


share|improve this question

marked as duplicate by Mark Trapp Oct 1 '11 at 1:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 7 down vote accepted

9001 people will tell you to start with jQuery, so I'll tell you the answer that won't be popular: learn javascript. By learning javascript, you will, by default, know jQuery, mootools, prototype, etc, etc, etc - because they are all javascript.

There's nothing magical about a library like jQuery, but it IS possible to dilute your understanding of the underlying principles. You're starting off from a solid foundation in server-side concepts, you'll want to have the same foundation in client-side concepts. Learn about DOM, learn some of the quirks of the language. Learn some of the headaches in cross-browser scripting, learn why front-end folks loathe Internet Explorer 6 - 8 (9 - 10?).

Once you have a good, solid grounding, THEN, and only then, should you think about picking up a tool like jQuery (or --> mootools! <--). Otherwise, you're taking a shortcut without knowing what exactly you're cutting - that's a good way to turn a shortcut into a longcut (to invent a term).

share|improve this answer
Hey, thanks for the nice reply, mate. A reply like yours was exactly the reason i wanted to ask experienced people first. =) Everyone tell me to start from jQuery already, and when i ask WHY, they say: "Just do it." And about the IE headaches, i tell you, if i haven't met most of them just with CSS already, at least i did a big number of them, hahaha. Once i even stood awake 'till 4 a.m. having to deliver a front-end at the 9 a.m. just to fix a problem with IE, including CSS hacks, properly doctype use and stuff like that. Anyway, really thanks for the tip. =) – Tio Felix Sep 30 '11 at 21:20
Yes, for some reason jQuery inspires fanaticism. I think you're much better off sitting down with jQuery after learning the ropes and knowing that the $.foo function is doing x, y, and z for me, so I don't have to do a and b. If you don't know a and b even exist and just learn to use $.foo, you're now crippled and dependent. Where I live, they have clinics for that condition, not something you'd lead someone else into on purpose. :) – Chris Sep 30 '11 at 21:27
One more caveat. Be very wary of JQ plug-ins. They don't have quite the same handle on peer review that PHP does and that's assuming PHP peer review at a minimum exists. – Erik Reppen Sep 30 '11 at 21:34

You can get a lot of the basics done with JQuery without knowing JS in-depth but you'll never be half as powerful with JQ without really knowing your stuff under the hood. Also, like regEx and SQL statements, it's a powerful tool but can also powerfully kill performance in a hurry.

I think it's okay for an experienced dev from another platform to start working with it but don't stop learning the core as you go and make sure you have an idea of what JQ is doing under the hood.

As far as stuff to learn ASAP, I would try to at least get a solid understanding of the DOM API and the ancestor/child relationship it banks on for accessing HTML and attributes, the cross-browser DOM API issues (particularly in IE before 9) that JQ normalizes ( is a good place for that information), and get comfy with the use of object literals in JS and passing functions around as parameters.

If you're supporting IE 7 or below, the biggest JQ gotcha to know is that there is no native document.getElementsByClass method working for you under the hood. Writing selectors like $('.someClass') will hit every single element in your document and throw logic + (I assume) regEx at the class attribute at the interpreter level in those browsers rather than native code the DOM API binds to under the browser's hood. This can be devastating to perf in large documents. Simply narrowing down with $('div.someClass') helps quite a bit but it's best to narrow down to the closest ancestor with an ID.

There's lots of tricks to reducing work avoidance in JQ selectors like using '>' when you can to prevent deeper recursion but that's the big one in older browsers.

But as I said, make sure you maintain curiosity as to what JQ is actually doing. You'll learn a lot about JS in the process.

share|improve this answer
Your reply makes me feel relaxed knowing my head was in the right way. I always thought that, even though it might take some time, it's much better to know what happens "behind the scenes" for better understanding of your own code, and also, quick problem fix skills. Thanks =) – Tio Felix Sep 30 '11 at 21:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.