Also, check out how to code a temperature converter! kzitem.info/news/bejne/q2mDr4WKsYhpYJg
@sunnysarthaven
3 жыл бұрын
Thank you for the tutorial. EDIT: I figured it out!
@rem4rk37
4 жыл бұрын
Thanks, man! Worked like a charm! :)
@codewithbubb
4 жыл бұрын
Thanks! Glad you found it useful 😀
@johneebravo2141
Жыл бұрын
Hi, how would I go about setting it up on a wordpress post?
@Zerikix
Жыл бұрын
Thank you very much, is there somehow I can make only each name come out once and not be generated again? I'm using messages instead of names here, so it's just one string, I wanted each message to be viewed once only and not be repeated, how can I achieve that? thanks in advance
@codewithbubb
Жыл бұрын
Thanks for your question. Yeah sure, the simplest thing would be to use the .pop() function on the array and get the last element from the names array which then remove it from being used again. Of course if you want it to be a random name, you could select the random item at the array position and then use the splice() function to remove it. Have a look at those functions and let me know if you need help.
@Zerikix
Жыл бұрын
@@codewithbubb Thank you, I'm very much a beginner, I tried look up the splice function, could you direct me to a tutorial or somewhere where I can apply it with the random generator? thankyou
@codewithbubb
Жыл бұрын
@@Zerikix I did a tutorial on slice/splice a while ago: kzitem.info/news/bejne/0KFjyq2XcJp_oGU With regards to the random names, when you're getting the random number, you'd need to use that as the splice starting point. Take a look and if you're still struggling I'll see if I can knock up an example for you.
@mdoyledesigns
2 жыл бұрын
Hello, do you wrap the JS in and place in the of an html doc? If, so I cannot seem to get it to work.
@codewithbubb
2 жыл бұрын
Hi Melissa, if you wrap your JS code in the tag but place it *just before* the closing tag. This way, the elements on your page (the HTML) will be present before you try and access them with your JS. There are some specific 'onload' functions that you can use to ensure that the document is loaded before working with it using JavaScript but the above should sort your problem out.
@mdoyledesigns
2 жыл бұрын
@@codewithbubb thanks I'll try!
@sunnysarthaven
3 жыл бұрын
Another question for you: how would you do this with images? I'm thinking of having 2 const categories and say, both images pull at the same time. Do you have any advice for going about that? And ty!
@arfankhanjeelany1120
4 жыл бұрын
Amazing! Really helpful :D
@codewithbubb
4 жыл бұрын
Thanks Arfan! Glad you found it helpful.
@TinaEarnings
2 ай бұрын
Is it possible to make 5,000 random names?
@roseninety
4 жыл бұрын
Subscribed! Great vid. Any chance you could talk through how to use data from a file or api like you mentioned at the end of the video? Been trying to figure it out for a while :)
@codewithbubb
4 жыл бұрын
Great! Glad you enjoyed it. I just made a video for you where I load in a file of names and serve up a random one through an API. Hope you like it. Check it out here: kzitem.info/news/bejne/1mauuZeeqZyYdHY
@Dnaliaht
2 жыл бұрын
I want to use this using letters to create new names... not just assembles, where can I learn more - Adding If = A add random between "d l m" to it... Ect
@codewithbubb
2 жыл бұрын
You could obviously replace the names with characters but you'll end up with some interesting names!
@steezmunky
Жыл бұрын
How would one allow a user to generate only male or female names?
@TheOfficialBloxerYT
5 жыл бұрын
Hey, I have typed all of the code. I think I messed something up in it or is this code outdated? Can you please send the Java Code in a comment?
@codewithbubb
5 жыл бұрын
Hey, oh sorry about that I did mean to include a link to the completed project: codepen.io/codebubb/pen/xBKOpb If you're still having problems, let me know what error you are getting out what's going wrong.
@TheOfficialBloxerYT
5 жыл бұрын
@@codewithbubb thank you so much! It is working now. You need more subs, so I subscribed. Wish you the best of luck with your channel!
@codewithbubb
5 жыл бұрын
Thanks so much! Glad it's working for you now.
@aidendanu3916
3 жыл бұрын
how would i get the code to send a specific message for a certain name/number?
@Sanguivore
2 жыл бұрын
I know this video is a few years old by now, but I was curious: how do we get this to spit out more than one name at once? (This is my first attempt at trying to code *anything* since the early days of the Internet, so I'm an absolute novice. Sorry if this was an obvious question!)
@codewithbubb
2 жыл бұрын
Hi Carmen, apologies for the late reply. You could just call the getRandomName() function several times as the function will return a different name each time it's called. For example: const names = []; // an empty array for(let i=0; i
@Sanguivore
2 жыл бұрын
@@codewithbubb Thank you so much! I’ll give my hand at trying that and let you know how it goes!
@youris4095
4 жыл бұрын
Is there a way to make a bingo but if the word is used IT delete that word such as die(word)
@SalaciousBCrumb-tu5ci
2 жыл бұрын
I've successfully built this in codepen, but I can't seem to get it to work with html, css and js files made through Atom. The button does nothing. Using recent version of chrome, windows 10. Any advice?
@codewithbubb
2 жыл бұрын
Are you seeing any errors in your dev console?
@SalaciousBCrumb-tu5ci
2 жыл бұрын
@@codewithbubb Nope
@telefunkenguy6107
4 жыл бұрын
HELLO! Ι would like to ask for your help. The Generator works perfect, but i want the two ''buckets'' of names (first second) to be the same but i dont wont the generator to pick the same name twice (like John John for example) what do i have to write in order to avoid that?
@Sanguivore
2 жыл бұрын
Great question! I'd also like to know this. Did you ever get that sorted out? :O
@ellywhiley915
4 жыл бұрын
Wondering if anyone can help me? I am using Dreamweaver and literally copied the code from the CodePen link and I keep getting this error message on the first line of Javascript code: ERROR: parsing error the keyword 'const' is reserved
@codewithbubb
4 жыл бұрын
Hi Elly, I haven't used Dreamweaver in absolutely ages but it might be something to do with the version of JavaScript it's running perhaps. You could try changing every instance of const to 'var'. Oh, and another thought, have definitely have a variable name after const right? like const firstNames ??
@karandhaliwal8213
4 жыл бұрын
hey man, it's not working for me it says there is a (Uncaught TypeError: Cannot read property 'addEventListener' of null) i have checked my code multiple times for a type error but i cant find any. need help!
@codewithbubb
4 жыл бұрын
Hi there, can you share the code your are using? If you're getting that TypeError then chances are you're trying to set up the event listener on an element that doesn't exist so check your query selector is correct.
Please help, it says script.js:9 Uncaught TypeError: Cannot set property 'innerText' of null at setRandomBackground
@VLTNO
4 жыл бұрын
Btw I'm trying to do a button that changes the background
@codewithbubb
4 жыл бұрын
Are you doing this in Codepen? Can you share your code? I suspect your query selector isn't correct as you're trying to set the innerText of an element that's not found.
@codewithbubb
4 жыл бұрын
@@VLTNO Hey, sorry about the delay. KZitem can be a bit rubbish about letting you know when someone has replied! The code seems OK to me? I'm getting a random colour generated when the page loads. The only thing I can see wrong is the button is wired up: document.getElementById('generate') .addEventListener('click', setRandomBackground); Let me know if you're still having problems.
@VLTNO
4 жыл бұрын
@@codewithbubbOk
@VLTNO
4 жыл бұрын
Edit: Ok nevermind I just re-coded it and it works fine at the bit that it was giving me errors, thanks for the support!
@DeepMalikReviews
4 жыл бұрын
Nice info ❤️ Thank you so much .. but how to create 10 random names at a one time plz help sir
@codewithbubb
4 жыл бұрын
You can just just run the function 10 times, like with a for loop perhaps?
@janlawrencemadali4635
3 жыл бұрын
Awesome! Thank you. How about for example I have a 50 person and I want to get the 20% or 10% of random person?
@iloveducttapehauls
5 жыл бұрын
i'm trying to make a name generator with three buttons: one for girl names, one for boy names, and one for unisex names. i'm not sure how to code for multiple buttons without disabling the function of the first button. any advice?
@codewithbubb
5 жыл бұрын
Depending on exactly what you're trying to achieve I would create three buttons with 3 separate event listeners (you could combine them all in to one and parameterize it but I think for just three buttons this would be OK). Each event listener would then call a random name function for each type of name (unisex, female, male). I updated the Codepen we used in the video to demonstrate one way of doing this: codepen.io/codebubb/pen/ZdZQJG Maybe that helps you out with your scenario?
@iloveducttapehauls
5 жыл бұрын
@@codewithbubb thank you!!
@codewithbubb
5 жыл бұрын
You're welcome :) Hope it helps you out.
@Flipvb
5 жыл бұрын
What kind of program do you use to make this
@codewithbubb
5 жыл бұрын
Oh, it's just codepen.io - you can use it to mock up simple pages or just experiment with a bit of code! Of course, you can do the same in your own text editor and achieve the same.
@violet4447
5 жыл бұрын
sir, I want to add here categories like for American names, there are different names and for French names, there are different names, I hope you understand me, Please tell I really want to know that.
@codewithbubb
5 жыл бұрын
Sounds like a good idea. You could create an object that has properties for the different countries, then put your first and last name arrays inside each property (if you want different names for each country). Did you want the country selection to be random also?
@Shogundoxie1414
4 жыл бұрын
What Program are you using?
@codewithbubb
4 жыл бұрын
That’s codepen.io
@HeartmadeDesign
3 жыл бұрын
that's so cool! I just created my own painting ideas generator :) I was wondering if it's possible to add links to the results, and if so... how?
@GoGroomer
5 жыл бұрын
This is a great tutorial! Thank you:) I need to create this for a 1000 subscriber giveaway on my KZitem channel. Can’t wait to try it😊
@codewithbubb
5 жыл бұрын
Thanks very much! Not long until you hit 1K subs - Good Luck!
@GoGroomer
5 жыл бұрын
@@codewithbubb Thanks, it's a slow climb (haha)
@codewithbubb
5 жыл бұрын
Yep, I know what you mean 😉
@raaz7664
4 жыл бұрын
Hi
@codewithbubb
4 жыл бұрын
Hi 😀
@ThreeSixNine...
4 жыл бұрын
My initial function doesn't log a random name, just the function itself...
@ThreeSixNine...
4 жыл бұрын
Okay, I figured it out.
@melinaelisa3847
3 жыл бұрын
upvote
@hackd6959
4 жыл бұрын
I ca not believe that I at last found a web app that works. Received so many free coins and gems from Gamecrook.
@reansiecamay7739
3 жыл бұрын
gamecrook is the real deal, no scams
@sanzoo245
3 жыл бұрын
Yo, what is wrong with youtube these days, so many spam commments. It is getting really annoying. Don not believe the scam spam comments, just Gamecrook worked.
@asianman103
3 жыл бұрын
didnt work at all
@meenaujjainey1331
3 жыл бұрын
Guys, thank me later, but you can get free gems, coins, gold or whatever at Gamecrook.
@habibetalbo7268
3 жыл бұрын
....
@finnostudios6327
4 жыл бұрын
My friend used all of these websites thinking that they are legit, however the only legit one seems to be GameCrook. I hope I saved your time as well.
@suzantaleb1763
3 жыл бұрын
After throwing away so much time on fake websites, I wanna save your energy and tell you that the only website that worked is Gamecrook.
@jeffysha8527
3 жыл бұрын
It looks like Gamecrook is the sole working website. I can not believe that there are so many spam web apps on KZitem.
@arunajha3954
3 жыл бұрын
Too many fake web apps in the comments. The only one that works for me is GameCrook.
@omkharche6170
3 жыл бұрын
For everyone searching for points, use Gamecrook.
@astriedfrance8543
4 жыл бұрын
Anybody here tried GameCrook, I've got a homie that used it and got so many free points.
@Steven_Oconnell
2 жыл бұрын
Title of the video should be "Random Name Picker", not "Generator" as nothing is generated here. I had to waste 2 minutes just to watch you paste a list of pre-defined names...
@codewithbubb
2 жыл бұрын
Apologies about the Steven. You're right it's probably not the best title.
@thecreativeoutlet7354
3 жыл бұрын
Anybody else used Gamecrook. It works.
@jeancarlosespinal9634
3 жыл бұрын
Hey, It appears that Gamecrook is the only real site. I can not believe that there are so many scam web apps on KZitem.
@kimgomez6758
3 жыл бұрын
It appears that Gamecrook is the single working web app for gems and gold. All others are scam.
@VINU07.
4 жыл бұрын
Gamecrook is awesome!
@jcveney12
4 жыл бұрын
This is so confusing you are changing the code way too much. use a code and stick with it way too much changing and mines do not work explain it better. i do not get the random name
@codewithbubb
4 жыл бұрын
What are are you confused with? If you can share your code I can point you in the right direction.
@jcveney12
4 жыл бұрын
@@codewithbubb Okay thank you how do i send you my coding
@codewithbubb
4 жыл бұрын
If you’re doing it on codepen.io then post a link in the comments or use a GitHub gist perhaps if not.
Пікірлер: 100