It's just creating a dom element. Just look up how to do that.
Specifically it's pushing it as a child to the list.
That said I don't offhand know how to do that, so look it up. I almost never write vanillajs, since I deal with fairly big applications. Usually I end up using vue or react or elm or something to get a better performing result and nicer templating.
Hudson Jenkins
Getting into web dev with some programming experience already, and wanted to contribute to projects on github. How do you deal when scripts and installation never works the way docs say, they have docker things to set up some of the services but the docker containers never build right, etc.
I'm 50% confident the problems I'm coming up against are not my fault, and I can usually figure out what's wrong if I spend the time on it. But overall, how much labor and errors should you expect to go through setting up a dev environment for a web app that has like, your standard database, API server and frontend app?
How do I tell if I need to git gud, or if I'm dealing with a project that's simply not maintained well or has bad docs? I've only tried a couple of them so far.
Some of us over at /sci/ are working on a cure for several kinds of blindness (). We are making really amazing progress and are beginning to get media attention (there should be a Vice article up this weekend), but right now we have no web presence. I could make a pretty nice website, but I'm too tied up with the other research aspects of the project.
We're not really sure what to put on it. Our documentation is really bad because our main focus is on research. Maybe some kind of basic tl;dr landing page for now?
Anthony Miller
Okay, I'll make a pull request to the git with something in a couple hours.
Angel Hernandez
I can't figure it out properly, I can add it to the page but I can't make it into an while also adding a class
..I'm just going to use jqeury, youmightnotneedjquery is no help and this is just stupid.
Tyler Ward
Awesome, thank you!
Benjamin Adams
Mate.
let li = document.createElement('li'); li.classList.add('className');
Don't give up so easily.
Juan Sanders
I think it does this:
todos.forEach( (todo)=>{ let newTodo = `${todo.name}`; let lists = document.getElementsByClassName("list"); for(let i = 0; i < lists.length; i++) lists[i].innerHTML += newTodo; });
Julian Scott
var newTodo = document.createElement('li'); newTodo.innerHTML = todo.name;
Parker Thomas
Sup webdevs, how much do you guys make a year?
I'm about to get a job in webdev (even though i really dunno how to do much of anything) and im guessing the salary is around $45,000. How does that compare to you guys? I live in appalachia btw.
Chase Williams
$70K/yr, 3rd year.
Robert Perry
>Guys gets little help >Pretends to give up and use jQuery >4 replies within minutes We got baited.
How does the Heroku Free ClearDB/MySQL shit work? is it like 1GB maximum of database size on disk? I can't find info about this
Owen Campbell
guys I am the designated IT guy in a project team of 3 people and I gotta setup a simple website + webapp
I have been thinking about using bootstrap + react front end and php for server side (php bc I already had to learn it b4) what do you guys think? any tips/programs for making it easier?
Ethan Thompson
Goodness gracious me, I'm in a pickle of a pickle patch tonight /wdg/. Just give me a second to paste my code into a JSBIn and then you will all see just how much of a pickle I am in. Oh, good grief.
Joseph Davis
It's a pants on head retarded way of writing const lists = document.getElementsByClassName("list"); for (const { name } of todos) for (const list of lists) { list.insertAdjacentHTML("beforeend", `${name}`); }
Zachary Scott
>he writes his method chains on one line
Hunter Richardson
What's your coding music, /wdg/?
I like listening to Gas and other ambient "artistes".
Maybe a better thing is to list what you want to learn.
Maybe for context though I should mention that I do a lot of backend work j in scala, and feel pretty at ease switching language in general.
Functional programming is probably the biggest thing I have of value to offer. But just say what you want to learn and I'll tell you if I can be of help.
The character count shows after you've focused on the input field then blurred. I want it to show up the first time you focus. But all the stuff is inside an oninput event handler. Which I need to keep it updating with each keystroke.
What in frick do I DO about THIS /wdg/
Luis Jenkins
nothings wrong dude
Christopher Morris
wrap the construction of the text object in a clojure which is called, setting up the entire thing with an initial value.
PKA, MF Doom, DAM, Гpибы, Noize MC, Gorillaz, Childish Gambino, Death Grips, 25/17, Higher Brothers, Rich Chigga, Лyнa, Taylor Swift, Mos Def, 50 Cent, Linkin Park, Blur, Foo Fighters, Johnny Cash, (((Bob Dylan))), Who See, Drake, etc
This doesn't solve the problem I'm trying to display. And I wasn't going for that full airbnb style, I just think semicolons are good.
Are you the same guy as , because if not I still want to know what the three things wrong were.
Juan Diaz
what do the other 2 fags in your team do
Luke Mitchell
Because let is not immutable.
I'm the same girl yeah. And I was miscounting, it was 5.
Grayson Thompson
they collect info for our databases, get connections with businesses etc
I don't trust them with the technical stuff they were barely able to use joomla and wordpress
Nicholas Turner
you have a lot of faith in /wdg/
Do you have content ready for a site? Maybe post it and see if someone comes up with something usable.
Henry Barnes
>trailing commas
Logan Barnes
I got it working all by myself anyway using axios instead, my main problem was that I was just trying to appendChild to a string, so I just selected the list and then figured it out that way. function getTodos(res) { res.data.forEach(function(res){ var newUl = document.querySelector(".list"); var newTodoList = document.createElement('li'); newTodoList.innerHTML = res.name; newTodoList.classList.add('task'); newUl.appendChild(newTodoList); }); }
This guy's one worked though
Jack Gomez
Alright, fair enough, I just tend to default to var when it's not a real project so I know I'm not gonna be compiling with Babel. And what's the advantage of the trailing comma again? I was never clear on that one.
The lack of semicolons was the point that I was trying to demonstrate, and if you run the code sans semicolons, you get unintuitive results.
Nicholas Miller
Nor is const. In fact that's a perfect example of it.
hey /wdg/ just wanted to ask if anybody else uses paint for concepts sometimes
Samuel Wood
Thank you both for your kind assistance
Hudson Campbell
The references are immutable.
Same as final in java, and general const mechanics in all languages.
It's also one of the reasons I seldom work with JS and such langs ;)
Cheers.
>tfw still no one wants tutoring shits with chat and glitch.com things
Bored and don't feel like working on main project = 2am pain.
The trailing comma style allows for lines to function in isolation. IE, you can add or remove lines without thinking about the comma, comment them out, etc, whatever.
In the one-line array it was more to be pedantic than anything.
Chase Diaz
glitch.com is great lots of ideas for projects
Adrian Gomez
Sometimes.
Got an idea for a thing to make?
Brayden Lewis
>Got an idea for a thing to make? Only my existing main projects, which I guess I wouldn't mind help with while bringing someone up to speed.
Whatever you kids want though I guess.
Kayden Gonzalez
w.. w.. wots vanillia html/css/js /wdg/?
And also. Advice for a newbie in webdev. Im looking more into backend development. But dont know where to start. Cos idk anything about webdev
Nolan Hughes
>kids
how old are you gram pa
Kevin Nguyen
It just means the language without excessive use of large frameworks.
I await someone to take the invitation and make something for fun.
I encourage you to use Elm or PureScript :3
Carson Butler
What's it made with?
Sebastian Jenkins
>I encourage you to use Elm or PureScript :3 but i don't know those languages
Robert Fisher
The front-end for the thing I'm working on at present as a hobby is in Elm.
The backend is going to be haskell.
Parker Anderson
Then tell me what you want to use.
Nathaniel Phillips
Moment js is pure bliss for working with dates and it comes with locales.
Evan Garcia
>Moment js is pure bliss for working with dates Why and how is it better than the in-built Date object
Brandon Scott
If you go through their docs you'll perhaps notice that moment.js has a bunch of methods that you can use to make your life easier when working with dates, like getting the difference between dates, getting the elapsed time from a set date, locales which came in super handy etc. For a larger project, moment js works great for me.
Live in the midwest and make 52k/year after my 3rd year of doing it after switching from Graphic Design. (recently got a big bump by switching jobs)
Jose Watson
If I have a list of about 40 products on a page, how could I sort through them to find a specific title? I want to match titles based on the text between the tags. I want to store the ones I want in an array for later use. I'd actually like to store all the parent classes to it, so up to product. Want to do this in javascript of jquery.
Render a product from JSON object. Makes it way fucking easier.
Adrian Watson
what does this even mean? you're scraping a page, or it's yours? why do you need to store the class names? you're doing something seriously wrong. use a framework.
Brody Morales
Snagged another client? Go back to basics before tackling intermediate projects, pajeet!
Colton Martinez
Oh no. I'm just trying to scrap a website. It is just for fun and practice. I wanted to grab just a couple products. Put them into an array and pop them out in a different div.