Hi everyone,

I want to get started on learning jQuery Framework.I got the basics of the JavaScript at this stage. But now, I don't know where to start with jQuery.

Other than the jQuery.com website. Would you suggest easy-to-follow introductions to jQuery?
Is there a big difference between jQuery and jQuery for mobile? Would JQM work for desktop websites as well?

Cheers,

Here use this website for jQuery tourtials: Click Here. jQuery is a very easy library to learn, it will probably take you 2-3 days.

@zoreli.. I signed up for this course but I didn't have the time to sit down and follow the tutorials. Thanks for it anyway. I will see that as an encourgement towards taking the course with tutsplus.

@godzab... it takes Two to Three days to get the hang of it. That would be awesome, man.

What confuses me is that people assign a function to a variable like the code below
var hug = function(male, female){return male + female};

that is what you call a closure function. What is the advantage of doing that?

The advantage of closure is to capture variable scope. Below is a use of closure in order to pass keyboard event which is the only way to pass in or the argument value is wrong. This is the prototype style I do by the way.

// The acceptKeyBoard() function is the AKlass member function which is
// customize & defined inside the class itself.
AKlass.prototype.attachMyKeyboardEvent = function() {
  var self = this
  if (document.addEventListener) {  // anything but IE
    document.addEventListener("keydown", function(e) { self.acceptKeyboard(e) }, false);
  }
  else { // IE
    document.attachEvent("onkeydown", function(e) { self.acceptKeyboard(e) })
  }
}  // attachMyKeyboardEvent

@Taywin .. I'm still even confused by the code you posted..

Hmm.. OK. How about this... Do you understand static variable in Java? When you create a closure in JavaScript, variable inside the function scope could be seen as static even though it is not exactly the same. In other words, when a function is call, normally its local variable will be removed from the memory once the function is done. Closure keeps its value as it is. Also, if you pass variables to a closure in the way I show you in my example, the variable will function similar to static variable. Hope this help you understand a bit more.

@rotten69 - you're not alone..that doesnt make much sense to me as well. I am in the process of learning some more advanced techniques in JavaScript and some of the libraries out there including jQuery.

I'd suggest a good book..the sites mentioned only provide you only a basic understanding in 2-3 days.

commented: Well, that is life. Problems are shared. Hehe +5

As far as beginning JQuery goes, you definitely need to download and link to (or just use an online host like Google) it every time you intend to pull from the JQuery library. That's sort of a 101 on the 101 if you understand.

That's sort of a 101 on the 101 if you understand

I got no idea what you're talking about, mate.

Do you understand static variable in Java?

I defintely do. Static type makes the calling of a method or a variable easier. I still don't understand in JavaScript though. When would I ever have to use it?

Err... I may confuse you more and more... How to explain this... Many people use the closure when they do not really gain any benefit from it, so it confuses those that don't know what it is. Anyway, this forum should at least give you a much better idea... I failed to explain it to you... :(

I failed to explain it to you

hahaa.. Man, don't panic. it is all good. At least, you've tried explaining to me. Even though I didn't get it for the first time, someone may do.

Thanks for the effort.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.