Yadon: Say i add 5 more languages like javascript. then what’s preferable ;
Poullion: Am i not calling the function ?
Keitsock: Krambal: that’s not a fiddle. that button will disappear after you wipe out the contents of #words. you need to click the button to trrigger its click handler that you defined here
Keitsock: Console.log does nothing
Ausmus: Lol sorry i was told to drop a console.log in there
Leta: Oh hmmm it looks like this return await languageslanguage await languages’default’; is just getting the function and not executing it
Keitsock: Why wouldi t execute it?
Keitsock: Functions are executed with parenthesis
Nishioka: Finally, i can send message, had to register.
Deisher: Just feels weird to write it like that i guess
Quammen: Where the function name is dynamic-ish
Keitsock: If it makes you feel better you can do var cb = languageslanguage languages’default’; return await cb;
Strength: Return await languageslanguage languages’default’ ;
Sticher: The button is on the included file cjohnson
Brotman: I have a minor doubt, is it standard practice to return a value from every function in javascript?
Ginder: Makes me feel better, not sure O.o
Keitsock: Krambal: doesn’t matter, your binding is not delegated
Keitsock: So when you clear that first button out, your event handler will stop being bound to anything
Nicklaw: Is this method generally preferred to switch or if/else?
Gerrero: Krambal: Understanding Event Delegation jQuery Learning Center http://learn.jquery.com/events/event-delegation/
Keitsock: Tejasmanohar: I *almost* wrote my first switch/case the other day. then decided it still wasn’t a good use case for it
Curles: What happens if i don’t return a value from every function, any security bug possiblity?
Keitsock: I just find it to be too verbose for what it offers usually
Keitsock: Curles: returns undefined
Keitsock: Whether that has security implications.depends entirely on your code
Keitsock: If “undefined” propagating through your code lets them through security holes then yes 😛
Farrill: Hey guys how would i make a periodic table i made using html and css have an animation like when u click an element it stays clicked or unclicked, or do i just add a button element to the html for simplicity
Lueschen: Guessx yess i did, nothing work’s
Curles: Keitsock, what if i just return true or false in every function. is it standard practice like one do in c ?
Keitsock: Blik71: an animation like when you click it stays clicked? what does that mean?
Frishkorn: Guessx will paste the code like i have it now
Memmer: I’ll think about that now . O.o
Keitsock: Curles: there’s no standard practice, you’ll have to use your brain to figure out the appropriate return
Keitsock: You don’t have to return every time
Ridgebear: Return false; then you dont fly up to the top of the screen if half scrolled down a page
Curles: Keitsock, yep, correct. thanks.
Keitsock: Blik71: either way if you want an animation you probably want #css
Joice: Like say I have a periodic table, I click one of the elements in the table when I click it the element changes to look like its been pressed
Curles: Guessx, how’s that possible?
Keitsock: Blik71: that is no less ***ue than your original statement
Pendergrass: Guessx http://jsfiddle.net/6Ljqvcfy/
Keitsock: If you want to change the way things look that’s a CSS thing
Keitsock: Curles: they’re talking about the default behavior of click handlers — if you return false; it does the same as e.preventDefault;
Keitsock: So if you have a href=”#” id=”foo”click me/a do***ent.getElementById’foo’.addEventListener’click’, function { do stuff };