Forum Replies Created
-
AuthorPosts
-
Zac Gordon
KeymasterHi! Great question!
Firefox handles events a bit different and you can simply do this:
function( event ) { event.preventDefault; }
That approach you took would probably be fine! Could you point me to exactly where you’re seeing this so I can respond in more depth?
Thanks!
Great questions!!!
Zac Gordon
KeymasterOkay Sara try again! Not sure what happened there but you should be good now!
Zac Gordon
KeymasterHi Sara!
Did you already enroll using the promo code in the scholarship email?
Zac Gordon
KeymasterGreat point Jeremy!
We are going to get into scoping and hoisting in our advanced JS topics, but you are right on point there and it’s a good thing to mention about seeing it in other people’s code (even some of my examples in this course).
I couldn’t really find a concensus on plain function declaration v expression and variable assignment, but if using the former it’s best to wrap your code in an IIFE to avoid it being hosted all the way to global scope.
It’s kind of similar to what happens when you assign a variable without using var, which is why I felt the named function expression was a little “stricter” in some way so possibly better to encourage.
Since making those videos I have talked with folks who say just regular function declarations are fine if in an IIFE.
Thanks for bringing up this whole topic and good point that I didn’t mention in the videos. Looking forward to digging into this deeper very soon 🙂
Zac Gordon
KeymasterOh good! Sorry I missed that 😉
We’ll have some more changes coming soon that will make the whole site more usable 🙂
Sorry for the confusion! Happy to help 🙂
Zac Gordon
KeymasterHey Frank,
On the Welcome page you should see Parts 1-4 listed in the main content area. When you login is that Welcome page blank?
That link in the navigation to the Master Course is just to the enrollment page, not to the content for the course itself.
You should see the courses listed on that welcome page, please let me know if you don’t. I checked that you do have access to it all so it should show up for you.
Zac Gordon
KeymasterHey Frank,
After you login you should be redirected to javascriptforwp.com/welcome where the parts of the course are listed. Does this not happen for you?
Zac Gordon
KeymasterAs we will discuss more on Eslint later, it runs based on a configuration file. If it is not configured properly you may not get the expected results.
It looks like the error message before adding configuration information simply says it needs configuration information.
Zac Gordon
KeymasterOkay, so it looks like it is working, it’s just finding errors based on the default configuration.
Try checking that there isn’t an error in app.js where it suggests.
If you’re just running it on the sample code it should work properly.
We haven’t covered eslint config in much depth yet (we will) but it may be that there is a global rule that is different than what I had in the demos and that is conflicting.
Have you changed any of the sample code or are you just running the default demo?
Zac Gordon
KeymasterThis is getting a bit beyond what we have officially covered so far, but a good question.
Does this setup here help?
Zac Gordon
KeymasterAh, I think you want to use the for of loops in this case. The for in loop is for looping through properties of an object, not so much for loops through items in an array.
Is that it?
Zac Gordon
KeymasterI used the for loop just to make it as a simple as possible in terms of using Vanilla JavaScript.
While technically the for loop may be a little faster to execute, the for in or for of loops are much cleaner to write.
I would suggest using for in and for of when they are appropriate.
As for your question about for in not working, it should work if you’re using it correctly. I don’t see an example of for in above tho, only for of. Is that what you meant?
Zac Gordon
KeymasterHey Michael!
In general you will be okay.
I do use some JS in the API content that I actually haven’t taught yet in part 1 (mostly ES6 and asynchronous JS stuff) so just be ready for things to look a little more advanced, but in general I think you’ll be okay.
The one thing I would recommend though is watching the webpack videos since some of the examples require you to know some basic webpack commands.
Hope that helps!!!
April 9, 2017 at 6:10 pm in reply to: 1.3.04 – Traversing the DOM – Differences between parentElement and parentNode #25479Zac Gordon
KeymasterHi John!
The problem might be that you’re using getSelector, which is not a real method. Maybe querySelector is what you meant and should work.
Also remember JS is zero indexed so the first element in an array is atray[0] rather than array[1]
Hope that helps a bit and great job practicing everything!!!
Zac Gordon
KeymasterSorry about that! Just fixed it! Had uploaded a fix to the video and looks like it got replaced. Should be good now!
April 4, 2017 at 11:58 am in reply to: 1.3.04 – Traversing the DOM – Differences between parentElement and parentNode #25293Zac Gordon
KeymasterYou are doing exactly the right thing!!!
There are instances when this type of skill comes in handy. For example, in the sidebar of the site students requested that the navigation toggle open and closed. To know when you click on a link what it’s parent is and how many children it has can be very helpful and necessary. I understand though if the concept seems a little abstract for the moment.
For selecting a second child you would get the array of all children and then use array[x] to get the specific child you needed. Or you could get the first child and then the next sibling of that one.
Again, this may seem like a silly or not helpful exercise, but as a front end dev there will absolutely be a time when buying complex UIs and interaction where you will need to get parents several levels up and work with children and siblings 🙂
Hope that helps and awesome work following along with the suggested exercises!!!
Zac Gordon
KeymasterOh good 🙂 just wait.. Got a lot more coming on this 🙂
Zac Gordon
KeymasterBecause it’s local you don’t have to worry about the security issue too much. In fact self signed certificates are not necessarily that unsecured either.
However when you launch a project live make sure you have ssl properly setup with your host 🙂
Not sure what happened with email notifications, but I have a redesign and rebuild of the site coming soon that will resolve this and some other weird issues.
You can always just go to javascriptforwp.com/forums to find you thread. Sorry about the inconvenience!!!
Zac Gordon
KeymasterHi,
In local you can enable SSL. It will still show a warning saying is not secure bc the certificate is self signed but you should have an option to proceed anyways.
On another note I had issues with Local in NGINX mode not displaying the /wp-json/ properly but asking in the local support forums resolved this issue (I think it was switching off NGINX mode)
Does this answer what you were asking?
Zac Gordon
KeymasterHi!
You can join the Slack Community here: http://jsforwp.herokuapp.com/
Just remember that it is for community interactions and I only “officially” offer support for the course through the forums. But I agree 😉 It’s easy to hangout and communicate in Slack compared to a forum.
The open invitation link is new, so let me know if you have any problems joining!
Cheers 🙂
ZacZac Gordon
KeymasterHey Mark! Not sure what happened there, but could you try that again for me please! You should be good now.
March 29, 2017 at 8:58 am in reply to: 1.3.04 – Traversing the DOM – Differences between parentElement and parentNode #24977Zac Gordon
KeymasterYou’re absolutely right Bruno.
In the case of both Text Nodes and Element Nodes, you would only find them inside of other Element Nodes. For this reason getting the parent of any type and the parent element node will always provide the same results.
There may be some edge cases of different node types having different behaviors (I wouldn’t be surprised) but for these two node types on a page it is the case.
Good question
Zac Gordon
KeymasterOkay, this was a plugin that broke everything and should be working now!!!
So sorry about that.
Zac Gordon
KeymasterHi Jessica,
I am not sure what happened here but I am looking into it now..
Zac Gordon
KeymasterWhat?!! Super cool, didn’t think of that. I will look into it!
A number of students are in the same position as you and I do want to be able to provide captions so thanks for raising this topic 🙂
-
AuthorPosts