SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist
    Join Date
    Apr 2006
    Posts
    443
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript or jQuery?

    Hi

    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!.'

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,872
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    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.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,269
    Mentioned
    197 Post(s)
    Tagged
    2 Thread(s)
    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.

  4. #4
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    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.

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,872
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by AlexDawson View Post
    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).
    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.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,198
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    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 :P

  7. #7
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,194
    Mentioned
    17 Post(s)
    Tagged
    4 Thread(s)
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •