turingschool-examples / intermission-assignments

33 stars 217 forks source link

jQuery Fundamentals #83

Closed rrgayhart closed 7 years ago

rrgayhart commented 7 years ago

From Bocoup's jQuery Fundamentals.

Respond in the comments of this issue with:

  1. What is something you learned that was particularly surprising/interesting?
  2. What was something you already knew?
  3. Was there anything you feel you still don't understand?

Feel free to ask any questions about jQuery fundamentals here as well.

seeker105 commented 7 years ago
  1. I was really surprised to read about 'hoisting' variables and functions. I never suspected there was so much difference between a Function Expression and a Function Declaration. Also, learning about JSONP was new for me.
  2. Variables and how to set up a for loop were both things I already knew.
  3. Working with jqXHR objects, deferreds, and JSONP. The events and event handlers aren't too new, but there is a lot more to handling these events than I realized.
ghost commented 7 years ago
  1. jQuery's chaining allows for the minimization of repeated code, since setter methods return selection they're called on. This means that I'll be able to have DRYer code in jQuery.
  2. I was already familiar with the very basics of jQuery, including selectors.
  3. Deferreds. Specifically, I don't fully understand the difference yet between deferred and promise, and the .pipe() method, although I will work on that this week between now and the beginning of classes.
    • Why does JavaScript return decimals differently than other languages (e.g. 0.300000000003)? What can I do in my programs to avoid this issue?
    • Why is it much more efficient to use CSS nowadays for animation instead of JS? In what situations should I still use jQuery instead?
lucyfox4131 commented 7 years ago
  1. I found it interesting that JS is loosely typed and certain things may not always result in an error, just won't give you back the answer you expect (especially when doing math). 2.Most of this tutorial was a review in concepts we've already covered about jQuery, but it was a good way to bring all the concepts together and get an overview of how they work together.
  2. I feel a little fuzzy still on deferreds and how to use them.
nickpisciotta commented 7 years ago
  1. You can change the context of this by using the .call() or .applly() methods and pss the object you're working with as an argument to these functions.
  2. I was pretty familiar with the event handlers, but surprised to see how may there actually are. Aside from click and mouse hover, I probably don't see much use for most.
  3. Deferreds still are an enigma. Don't really feel like the explanation provided elucidated this topic at all. May need more work with innerHTML method and the concept of working with raw DOM elements. Also, what are the advantages/disadvantages of using jQuery animations as opposed to CSS?
rgbatty commented 7 years ago
  1. I found the difference between function expressions and declarations to be interesting. I always assumed that they were merely a difference in syntax, and not in functionality.
  2. After heavily using React Native in my personal project, it was nice to see ASync code touched upon and that I had properly grasped the basics of it (Then, Promises, etc.).
  3. I'd like to see ASync touched on more. I feel like its definitely a black hole of knowledge, and that it could provide lots of value or lots of headaches depending on how much its touched during Mod 4.
AnnaCW commented 7 years ago
  1. I was interested to read about .eq() and .is(). These will be really useful. I also wasn't familiar with the term 'hoisting'.
  2. I was familiar with the JS and jQuery fundamentals, but it was a good review and I learned about some new methods.
  3. I need practice with deferreds in general, and I'm not sure I understand .promise().
ErinGreenhalgh commented 7 years ago
  1. It was interesting to learn about event bubbling and delegation. I feel like I definitely need some more practice, but it was good to learn about them as ways to make your code more DRY and dynamic, since it allows you to bind to high-level elements instead of every single low-level element and keeps your event behavior predictable as you change low-level elements.
  2. The basics of JS and jQuery, including transversal and manipulation, were review, though I did learn some more tips and details that were new.
  3. Hoisting in JS is still a bit unclear to me. AJAX is also a mostly abstract concept to me still, as I have yet to practice it in a project. I am unclear on the ramifications of making asynchronous requests.
icorson3 commented 7 years ago

1. What is something you learned that was particularly surprising/interesting? It is interesting that in javascript a variable is implicitly global if it does not begin with 'var'. Why wouldn't they just use the syntax without the 'var' all the time since that means it is a global variable. 2. What was something you already knew? A lot of the information was similar to other information we have learned in other articles. 3. Was there anything you feel you still don't understand? The call vs. apply methods were a little confusing as to why you would want to use them at all and not just pass what you want to pass into the function.

ckaminer commented 7 years ago
  1. I didn't know that you can bind multiple events for .on. I've already seen multiple places in idea box where this would have been helpful. I also didn't know there were so many listeners.
  2. I was already aware of a lot of the basics for both js and jQuery but often got them mixed up. This was a good clarifier.
  3. I don't feel great about event bubbling and delegation but feel that it will come with time. Now that we have gone through the process of learning a language (Ruby) it is a lot easier to understand concepts but bringing it all together to make clean code will take time.
Parker-CP commented 7 years ago
  1. The most valuable piece I feel I learned here was event delegation. I had implemented something like it in my personal project, but actually understanding what it is doing and how - to an extent - feels very powerful.
  2. I already knew quite a bit about ajax, I had implemented a small portion in the pivot and a lot of ajax in my personal project.
  3. The whole idea of Deferreds is still confusing to me.
robbiejaeger commented 7 years ago

1. What is something you learned that was particularly surprising/interesting? I didn't know you could clone elements. Seems pretty helpful if you only need to make a slight change to a complex element and then place it in the document.

2. What was something you already knew? I knew about AJAX and its asynchronicity from my Module 3 personal project. It was good to review it again for Idea Box, though.

3. Was there anything you feel you still don't understand? I understand how event bubbling works, but I am interested in what to watch out for since the event bubbles up all the way to the document level. Seems like it could be dangerous if you're looking at events at the grandparent level where an event source could become ambiguous.

Also, do animations run asynchronously? Are there any issues to look out for with triggering more than one animation at a time?

saylerb commented 7 years ago
  1. What is something you learned that was particularly surprising/interesting?

    • This is tricky: $() function always returns a jQuery object, and an object is always truthy, so sometimes it's hard to know if you've actually selected what you wanted to select.
    • Jquery has methods that can generate HTML with $()

      $( '<p>', {
        html: 'Hello!',
        'class': 'greet'
      });
    • You can clone objects? whatttt
    • Namespaced events are pretty cool
  2. What was something you already knew?
    • How to select stuff
    • Chaining
    • Altering elements
    • AJAX
  3. Was there anything you feel you still don't understand?
    • With es6, arrow functions change the way this is handled. This can affect you jQuery
    • Event bubbling and delegation, still need more practice with this