Javascript or jQuery?


I want to learn Javascript but I have seen that there is something called jQuery. Is it a replacement for javascript, meaning that I do not need to learn javascript and go immediatelly with jQuery? ‘sorry but i’m confused!.’

Personally im still learning javascript from the ground up as jQuery doesn’t always suit the basic needs of some scripts i may need to write. jQuery is always fun to use though for the very nice and well done animation :stuck_out_tongue:

jQuery is a library of code written in JavaScript that performs many common processes that you would otherwise need to code yourself.

To be able to use JQuery effectively you need to know a certain amount of JavaScript since all of JQuery is just JavaScript that someone else has written for you.

If you don’t have a reasonable knowledge of JavaScript before trying to use JQuery then you may end up like a lot of people where they have a dozen JQuery statements to do something that can be done in ordinary JavaScript in two or three statements.

Of course once you know JavaScript properly you can write your own scripts that are just as well produced that do just what you need them to do without the rest and end up saving perhaps 90-95% of the size of the JQuery script.

JQuery can’t replace JavaScript since it is all written in JavaScript.

I didn’t start using JQuery until recent. Up until than I didn’t want to have anything to do with it. However, my new job has forced me to open my eyes to the library, considering its their library of choice for JavaScript work and consistency. As I use it more and more its growing on me. Like others have mentioned I would highly recommend learning JavaScript to some extent before using JQuery. Using JQuery as a tool, rather than dependency requires knowledge of JavaScript in the fundamental form. Those lacking the fundamental knowledge tend to end stuck at every turn where jQuery doesn’t explicitly spell the solution out. Having been working with JavaScript for 3 years, before using JQuery it was pretty easy to pick-up. So once you have a good understanding of JavaScript, its not all that difficult to pick-up, at least in my opinion. Anything you can achieve with JavaScript can be achieved with JQuery, the only question is whether the library provides functionality/helper to do what you need and is it the best way to do things.

I recommend people learn both these days. It’s important from the offset to know JavaScript, especially when working with frameworks or complex code. Plus for those small scripts you don’t need jQuery for. But I also recommend people learn jQuery, it’s quite clear that the framework isn’t going to disappear anytime soon, and it really does simplify some otherwise complex code. jQuery does have the benefit in that many of the scripts are tightly written so you don’t have redundant rendering going on in the background (or bottlenecks). But jQuery is certainly not a replacement for JavaScript… that’s my two cents. :slight_smile:

I like jquery fine now that I’m a bit used to it. One of the issues I see is the filesize. Sure, jquery can do a lot of stuff and save me some code writing time. But there are times when the 70KB size of the minified file outweighs the benefits if I only need a few lines of simple javascript code that I can throw together myself.