This Random Name Generator tutorial gets back to many Javascript basics and is a good project to tackle after you have completed my full course Javascript video (kzitem.info/news/bejne/ppx30m2YsKyHjaA). An extra in this video that is not in the full course is a discussion of using innerHTML and how to sanitize the user input you receive before using innerHTML to display it.
@RodrigoMendoza7
3 жыл бұрын
I want to start by thanking you for each valuable tutorial, Dave. Going back to sanitizing HTML, I've found this developer.mozilla.org/en-US/docs/Web/API/Sanitizer/sanitize. It looks like we'll have to craft our own sanitizing functions until we get it as a standard. It's the first time I come across your way of sanitizing. To be honest, I had to rewatch it and hear you explaining more than once to get it. Before knowing the way you did it, I would have gone the RegEx way with the "replace" function.
@DaveGrayTeachesCode
3 жыл бұрын
@@RodrigoMendoza7 thanks! I do think the regex way is more common and there's nothing wrong with it at all. This way was interesting so I wanted to show it as well. Several paths to a similar destination 😀👍
@DucMinhTeaching
3 жыл бұрын
please, keep it up with vanilla javascript and getting back to the basics, the world is going crazy with arbitrary frameworks
@DaveGrayTeachesCode
3 жыл бұрын
Thank you, Dory! 😀🙏
@abbasmohamedwalaal5753
3 жыл бұрын
Keep uploading front end development like vanilla js , building complete website with html,css, js
@DaveGrayTeachesCode
3 жыл бұрын
Thanks Abbas! Much more to come 🙏😀🚀
@andrewclarke6916
3 жыл бұрын
Lines 23 - 28. I can't recall ever seeing a for loop being used this way before. I guess I'm used to the incrementor usually being defined at the start of the for loop. Good to see the continue statement being used too.
@DaveGrayTeachesCode
3 жыл бұрын
Right on! You can disassembled each piece of the for loop and put it elsewhere while still using it. As you said, you don't see it too often. Thanks for watching. 🙏
@cristianalvarez4405
2 жыл бұрын
Gracias Dave, estuvo genial el proyecto. Un saludo desde Colombia. Thanks Dave, You're a genius!! .
@DaveGrayTeachesCode
2 жыл бұрын
You are too kind, Cristian! Thank you my friend 🙏💯
@aya2222
3 жыл бұрын
Thank you for your wonderful project tutorial as usual. We can learn a lot of things from this short video. I wonder, we can still use it without " if(!display.classList.contains("hidden")) display.classList.toggle("hidden");" in clearSuggestions function because we put "list.innerHTML = "";" in clearSuggestions function and "if(display.classList.contains("hidden")) display.classList.toggle("hidden");" in displayNames function. Am I right?
@DaveGrayTeachesCode
3 жыл бұрын
Hey, thanks for your patience as it has taken me a few days to reply. It has been months since I looked at this project, but you may be correct. The innerHTML will not impact a class being applied or not, but you may be right about it being duplicated in displayNames. I suggest trying out your change and seeing how it works out! Good, thoughtful question! 💯
@aya2222
3 жыл бұрын
@@DaveGrayTeachesCode Thank you for your reply!! your channel is amazing and it really boosts me up to learn javascript. Do you have any front-end courses on udemy or anything?
@DaveGrayTeachesCode
3 жыл бұрын
@@aya2222 I do not have any courses available yet. I hope to publish one within the year. Thanks for asking!
@mohsenrostami3335
10 ай бұрын
thank you for your great contents, I have a issue with this project, and also I'm just start to learn js, hope some one can help me with my problem. I have a syntax error "cannot use import statement outside a module in jest", so what I did is that make a package.json and add "type": "module", this error was fix but I made a reference error "document is not defined" on line 12. also to be sure that code is ok, I cloned this project and this is not about code.
@andrewclarke6916
3 жыл бұрын
Really had to turn up the volume to hear you on this one, Dave. Is there a problem with the sound level on this video?
@DaveGrayTeachesCode
3 жыл бұрын
Not that I know of, but thanks for letting me know. I'll look into this!
@andrewclarke6916
3 жыл бұрын
@@DaveGrayTeachesCode Just trying to listen to this using standard laptop speakers but really have to turn the volume up close to full to hear you. The short musical intro near the start of the clip is coming through clearly though.
@DaveGrayTeachesCode
3 жыл бұрын
@@andrewclarke6916 that is strange. Comparing to other videos on my channel since your first comment, and I notice a slight drop in volume but nothing as significant as you are. I'm unsure of the cause but will check everything before I start recording again this evening. Thanks for letting me know :)
Пікірлер: 28