As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Learn JavaScript before learning JQuery?
I have read that thread and I still don't find any points convincing me that Javascript is a must-learn-before-jquery thing.
I think jquery is far more than just a javascript library, I would like to call it a redefinition of the dynamic language, the new javascript instead. The library writers clearly made the greatest hit here to change old JavaScript's face almost completely.
Javascript and Jquery are co-existing because Jquery is the javascript library and the fact that people support learning JS first before jquery is likely because they've been client side coders long before the jquery was out, WHICH CURRENTLY EASES THEIR INVESTIGATIONS INTO THE LANGUAGE FAR BETTER, psychologically, they certainly then say "Oh yes, procedural methodologies work greater".
For points concerning writing a function call via mouse/keyboard events, I still agree that javascript structures are preserved and need learning. But does this really make a big difference whether or not learning jquery first should be more beneficial at all ?
Ex:
function something()
{
//jquery code
}
////
<input type="..." onclick="something();"/>
Advice and corrections are required. Thank you so very much.
There are many reasons why its important to learn the native JavaScript, in addition to the jQuery Library:
jQuery is written in JavaScript, so if you ever run into a jQuery bug, or need to patch it, you will need to know the JavaScript
if you ever want to use jQuery efficiently, in many cases it's helpful to read the underlying JavaScript
it isn't guaranteed that jQuery will always be the best Library (something like Scriptaculous may one day surpass it), thus you shouldn't be library-dependent
in many cases you still need to run JavaScript inside of a jQuery function
jQuery may make many things simpler (accessing DOM elements), but in many cases it isn't required
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Can somebody please explain the pros and cons for below.
Am having a function to get the url querystring parameters, but I need to know which is the best way to write the function. Eg: if i create the function using jquery plugin style, then every time I need to use a target element to access the function as below
$("#targetDom").getQueryString("name");
However, if I create the function using javascript classes or javascript design pattern, it would be
getQueryString("name");
This is a small example but considering large application which approach is best? is there any disadvantage in going with jquery plugin way?
The answer will depend on who you ask.
My answer is, if you're already using jQuery on your page (meaning leveraging jQuery won't require you to import additional resources) then go ahead and use jQuery to write your extension. jQuery does internal chaching which I believe can actually make your code faster than using native JavaScript in some cases.
If you're not already using jQuery, using vanilla JavaScript for your particular task isn't complex enough a problem to require (or even suggest you might want to use) jQuery.
You don't have to create a jQuery function for every functionality, especially if you are not going to be dealing with the DOM, which seems to be your case.
However, you might want to group such functions in a small library of your own application, which can be reused in other applications as well.
For example:
var utils = {
getQueryString : function(name){}
};
and access it like this...
utils.getQueryString("name");
Eg: if i create the function using jquery plugin style, then every
time I need to use a target element to access the function as below
No, you don't. You can run the function like this as well $.fn.getQueryString("name");.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I know programming in general but always been doing either Delphi, VB 6 or C#.net! Now I must do web-dev and must do it fast! I haven't written a hello world in JavaScript yet and must learn jQuery because there are some charts that I must show in my web-app and looks like I must know JavaScript and jQuery to do that.
So I am looking for a jQuery resource that during its course or maybe at the first chapter gives us also a jump start on minimum JavaScript knowledge too. Some book or resource that I can hopefully sit and read through it in one day like 12 hours and after then learn enough to be able to use it and embed those darn charts and graphs into my web-app.
What do you suggest ?
The basics of Javascript as a language are actually fairly straightforward, particularly if you've got a background in several other languages as you have. You'll find it immediately familiar with curly braces and other syntax that you'll recognise from elsewhere.
If you've worked with C#, you will hopefully have been exposed to lambda functions or closures. These are very important in Javascript, where they are key for the event-driven code that drives most websites, and in particular if you're using a library like jQuery, where they are used for virtually everything. You need to get a strong handle on how these functions work if you're going to make head or tail of jQuery.
The other thing to be aware of is that Javascript's object handling works a bit differently to the other languages you's used to. There are similarities, but if you try to write your classes and objects in the way you're used to, you will get some unexpected results. See What type of language is JavaScript for more info on this.
Beyond that, I don't think you'll have a problem with the syntax.
The other thing to worry about is the DOM -- ie the browser's API which is accessed via Javascript. The DOM is not technically part of the Javascript language, but it is inextricably linked to it, and is as much part of the learning challenge as the language itself. jQuery abstracts a fair amount of the DOM away from you, but it still helps to know it.
Hope that helps get you started.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm learning web development and i have 1 year or programming experience with PHP, should I start with JS or JQuery? is there anything that can be done only with JavaScript?
jQuery is just a javascript library. So, jQuery is javascript - it is not another language. JQuery is written in javascript itself. You could not use jQuery without understanding javascript.
The very first thing you need to do is learn javascript. Then, once you've learned the basics of the language, you can decide if the extra functionality that the jQuery library offers would be useful to the problems you're trying to solve. So, you don't pick one or the other. You start with javascript and all the functionality that offers and then you decide if you want to ADD to that the functionality that the jQuery library offers.
Personally, if I was doing cross browser web page scripting, I would absolutely use one of the popular javascript libraries such as jQuery or YUI because they both make web page scripting easier and make it easier to do things in a cross browser fashion (the libraries themselves handle a bunch of the browser differences for you).
jQuery is a JavaScript library; you can't do anything in jQuery without JavaScript. So, you should probably start learning JavaScript syntax, since it is a prerequisite to learning jQuery.
jQuery is written in javascript.. jQuery is just a library where else javascript is a language itself. Anything that is done jQuery is in javascript.
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. ~ From jQuery home page
jQuery is JavaScript. It is not another language, but a library that makes some (cross-browser) tasks easier than when using vanilla JavaScript.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I apologize in advance as this question isn't directly related to a coding problem or question. Many web developers start out using jQuery as an essential library due to the massive amount of plugins available. It is fairly easy and requires little knowledge to implement a plugin into your code, and use it successfully. The downside is that it can be easy for a beginning developer to ignore learning JavaScript from the ground up, and depend on jQuery plugins to get them through most situations.
After years of doing this, a "developer" learns jQuery piece by piece, but does not have the fundamental understanding of how Javascript works or the mastery required to build custom functions or plugins. This is a common turning point where developers have a yearning to learn more, and really understand how this all works. jQuery aside, developers should probably learn JavaScript first, but this is commonly disregarded amongst beginners, as jQuery is easier to understand and simpler to write.
Although this is a loaded question, I am looking for a good direction to advance my understanding of jQuery AND Javascript. Having a solid understanding of jQuery, I really want to have the knowledge and flexibility to write any code in both jQuery and traditional JavaScript. I am looking for a good direction to advance myself, and for others in similar situations to move forward on the quest of js knowledge.
What are the best books, methods, or success stories you (the community) has from your struggles with learning JavaScript? What recommendations do you have, that myself, and many others can benefit from? Keep in mind, this question is on behalf of people who write jQuery on a regular basis, but struggle to really grasp all of the necessary concepts to master the language. And also, it is for people who started learning jQuery BEFORE javascript, and wish to have a fundamental understanding of both. Thanks in advance!
This is probably the number one reason I disapprove of jQuery. That said, I suffer from a similar issue: After using Game Maker to write my games for me, I can't travel down layers of abstraction and into the realms of C++ or similar without significant effort.
Going up layers of abstraction is easy, that's why abstractions exist in the first place - if they didn't, we'd all still be writing raw machine code. Going down is significantly harder.
Ultimately, all I can really suggest is that, depending on how much "plain" JavaScript you actually know, pick up a beginner-level JS book and start from the top. Just try not to deviate into "this'd be so much easier if I just used jQuery" - if you find yourself doing this, it's bad.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
The number of jobs I could apply for would greatly increase if I knew JavaScript, AJAX, jQuery and JSON. I've begun teaching myself and figured out, in some sense or another, they have all evolved from JavaScript. My question is how well (if at all) do you need to know one before learning the other and in what order?
Javascript. As this is the language that surrounds the other things you want to learn, it's logical to start here. Find out what Javascript is, the syntax, what it can do (and CAN'T do).
jQuery (mind the single r) is a Javascript-library, it means that it is just another way to write plain js-functions. You can do everything jQuery can in pure Javascript. The difference is that jQuery makes many things easier and corrects some flaws browsers have developed (hello IE).
Ajax (transferring information without pageload) is a feature in Javascript. You could either learn the pure js-way, or the simplified jQuery-way. I love how simple jQuery have made ajax-calls. My ajax-calls before I began learning jQuery was a mess! This is just an aspect of the entire jQuery-library, so some basic knowledge of their syntax, event-handling and such is smart before beginning to learn this.
JSON is just a way to encode a set of strings when you are using Ajax. With some basic knowledge of Javascript, this should not take you a long time to figure out.
That is the order I would suggest. With my comments you can see why I suggest them in this order.
Good luck :)
Javascript is the core of all the ones you listed as everything you've listed is written in javascript or uses its syntax. You will need to know core javascript in order to learn/use any of the other items you've listed.
jQuery is a popular and useful library built on top of javascript that adds lot of useful functionality and implements a lot of cross browser compatibility for you.
Ajax. You will probably want to learn the ajax stuff in jQuery as it makes ajax a lot easier than doing plain javascript ajax.
JSON is the data format often used with Ajax so you will probably encounter it while learning ajax.
I would suggest the order above.
Javascript is the language itself so you should learn it first. JSON is the javascript object notation so while you're learning Javascript you will be learning it too. Ajax is the API for async calls to the server so it has its own object which is consumed using JS. jQuery is a library which is built on top of JS.