These are chat archives for FreeCodeCamp/HelpFrontEnd

8th
Aug 2018
Ghost
@ghost~59209a78d73408ce4f6102e8
Aug 08 2018 05:57
@Pagnito yes. be sure to give them ownership of their domain name. there are some hosting sites that will pay you residual income for putting being through their service if im not mistaken.
Rob
@PGFracing
Aug 08 2018 09:33
what can I used for Developer Tools in Sublime?
Dhaval Vira
@dhavalveera
Aug 08 2018 11:15
Say more about your question @PGFracing
Yashwardhan Pauranik
@yashwp
Aug 08 2018 12:31
tundeiness
@tundeiness
Aug 08 2018 14:33
Hi guys I need help with the red border line part of this project. I am trying to reduce the height of the red border part on small screen such that it will scroll but I have not been able to do that even when I set the height to 50% on small screen here is the link https://codepen.io/highness/pen/bjjzJj
tundeiness
@tundeiness
Aug 08 2018 14:43
it has been solved...thanks
Ahmed Al-Gallad
@A-Gallad
Aug 08 2018 17:14
Hello alla
all
I have another jquery
question
Christopher McCormack
@cmccormack
Aug 08 2018 17:17
@A-Gallad sure ask away
here is the pen
@cmccormack thank you :) ... So simply, I have a table and buttons in every td
there is a button that says -1
Christopher McCormack
@cmccormack
Aug 08 2018 17:19
that pen is broken
Ahmed Al-Gallad
@A-Gallad
Aug 08 2018 17:19
oh
1 sec
Christopher McCormack
@cmccormack
Aug 08 2018 17:21
might just be me, not sure, but it keeps reloading itself
Ahmed Al-Gallad
@A-Gallad
Aug 08 2018 17:22
I am creating another one now, I am working on sublime anyways so I'll just copy paste the basic items
@cmccormack try this one
Ahmed Al-Gallad
@A-Gallad
Aug 08 2018 17:29
So what I am trying to create now is a function that subtracts -1 from remaining uses of each item every time I click the button
Christopher McCormack
@cmccormack
Aug 08 2018 17:32
@A-Gallad I'm assuming you want this to be dynamic. You can add an event that finds the sibling element to the decrement button that you want to decrement and performs the decrement function only on that element
Ahmed Al-Gallad
@A-Gallad
Aug 08 2018 17:34
so something line next() ?
Christopher McCormack
@cmccormack
Aug 08 2018 17:36
@A-Gallad maybe something like .closest()
Ahmed Al-Gallad
@A-Gallad
Aug 08 2018 17:37
alright I'll give it a couple of tries
Christopher McCormack
@cmccormack
Aug 08 2018 17:37
You can also attach the listener to the parent element and only trigger the decrement method if the event target is the button
that may make it easier to target only the children of that parent for whatever events
Ahmed Al-Gallad
@A-Gallad
Aug 08 2018 17:40
I was thinking to declare variables in the doc ready function, then use the closest() and html() methods to replace the content inside the <td>
use these methods in an on click event
that is
Christopher McCormack
@cmccormack
Aug 08 2018 17:41
@A-Gallad you can also do something as simple as use the data-* attributes dynamically
I tend to use that as it isn't nearly as complicated as trying to find a sibling
Ahmed Al-Gallad
@A-Gallad
Aug 08 2018 17:41
Oh thats actually easier :D
Christopher McCormack
@cmccormack
Aug 08 2018 17:44
yup and it shouldn't break if you move stuff around and your selectors aren't robust enough
Ahmed Al-Gallad
@A-Gallad
Aug 08 2018 17:45
yepp makes perfect sense
Thanks a lot :)
appreciate ur help
Christopher McCormack
@cmccormack
Aug 08 2018 17:47
np
Rogério Dalot
@Dalot
Aug 08 2018 19:48
Hello guys, could someone tell me if it is better for someone who is still learning, to manipulate the DOM entirely with vanila JS or with Jquery
A friend of mine told me that for example, querySelector is a very recent technology, and JQuery might be a better idea to work with at the start. This way, I can start to solve small problems and build something function easier...
What are your thoughts on this?
Thank you
Christopher McCormack
@cmccormack
Aug 08 2018 19:54
@Dalot I think it's good to learn vanilla, and once you understand it you can choose to use jQuery as well. jQuery has the advantage of public source code, so you can see how jQuery choses to implement
Rogério Dalot
@Dalot
Aug 08 2018 20:01
@cmccormack I was not trying to make a decision based on a single method, I am just trying to understand what is in JQuery right now that would provide me a better solution compared to vanilla JS. Am I able to solve more problems, etc... ?
Christopher McCormack
@cmccormack
Aug 08 2018 20:02
@Dalot dig into both and you'll learn a lot, no one way to do it
Rogério Dalot
@Dalot
Aug 08 2018 20:02
@cmccormack Oh but yes, he its more recent that my friend made me believe
@cmccormack I guess that is the answer for almost everything in progamming isn't it?
:P
Christopher McCormack
@cmccormack
Aug 08 2018 20:04
@Dalot pretty much
best to start building stuff, and see what is useful
it also helps a ton to just read the docs first - read jquery docs, learn what's available, read MDN docs, learn what's available, etc...
Rogério Dalot
@Dalot
Aug 08 2018 20:07
@cmccormack Hum, yes, I actually do not know anything better than MDN
I'll start with JQuery then, I already know the basics as I know vanilla but I feel that JQuery might be more suitable for me to faster the process of building stuff
@cmccormack Thank you so much for your kindness
Christopher McCormack
@cmccormack
Aug 08 2018 20:09
@Dalot np - you can always come here or HelpJavaScript if you have a question, lots of knowledge floating around
Rogério Dalot
@Dalot
Aug 08 2018 20:09
I'll start to hang around here, giving back when I can and ask lot of questions
Christopher McCormack
@cmccormack
Aug 08 2018 20:10
it's a great place, often quiet but usually someone around
Rogério Dalot
@Dalot
Aug 08 2018 21:37
How can I select the last child of an element? This could be any element, p, span, div... ?
Oh just got it
$('#example').children().last()