These are chat archives for FreeCodeCamp/HelpJavaScript

15th
May 2018
Greg Duncan
@GregatGit
May 15 2018 00:38 UTC
@JLuboff did you have to return a string literal? Using react you would just return <li>${action}</li>
Richard
@rylew0925
May 15 2018 02:54 UTC
So I hear FCC will be adding in new programming languages. Does anyone know when it will be out?
Richard
@rylew0925
May 15 2018 03:11 UTC
I wasn't able to find any updates for the java, ruby, python, php, and other programming languages that would be added. Was it somehow cancelled?
Dhaval Vira
@dhavalveera
May 15 2018 03:12 UTC
where you can't find Updates for Java, Ruby, Python, PHP and other Programming Languages ?
Brad
@bradtaniguchi
May 15 2018 03:12 UTC
@rylew0925 I don't know, its either in beta (I haven't tried), or its going to be focused after. Since a lot of effort is going into beta
lfvpCO
@lfvpCO
May 15 2018 03:18 UTC
hello guys
Dhaval Vira
@dhavalveera
May 15 2018 03:19 UTC
hello
lfvpCO
@lfvpCO
May 15 2018 03:20 UTC
i need a hand here.. look. I have a code that runs a javascript function but I want to send that result to a second html page.
Dhaval Vira
@dhavalveera
May 15 2018 03:21 UTC
means
lfvpCO
@lfvpCO
May 15 2018 03:23 UTC
i have index page with its javascript function.. it is a form to book a room in a hotel and I want to print the receipt in another page
Dhaval Vira
@dhavalveera
May 15 2018 03:25 UTC
means receipt should be redirect to second page
lfvpCO
@lfvpCO
May 15 2018 03:27 UTC
yesssss
that is what I tried to say
Dhaval Vira
@dhavalveera
May 15 2018 03:28 UTC
ok
Brad
@bradtaniguchi
May 15 2018 03:34 UTC
@lfvpCO Hmm, to render a "print-page" you might have to load the other page with the correct data by making a backend call
lfvpCO
@lfvpCO
May 15 2018 03:35 UTC
any documentation about it.. maybe a web page to have a look
Brad
@bradtaniguchi
May 15 2018 03:37 UTC
Might be able to print an iframe or something, so you can pass the data if your backend can't do it (or you dont even have one)
lfvpCO
@lfvpCO
May 15 2018 03:43 UTC
I need to print this result: document.getElementById("demo").innerHTML = total;
in another pages...
i cant print this in the same page.. but the exercise says in another page.
Brad
@bradtaniguchi
May 15 2018 03:54 UTC
The exercise?
lfvpCO
@lfvpCO
May 15 2018 04:48 UTC
we are coding a website at the uni..
Claudio Restifo
@Marmiz
May 15 2018 05:19 UTC
@lfvpCO can you use a backend or you need to use only frontend strategies?
cosi backend is definitely the cleanest / most reliable solution
otherwise you need to use window.open() and inject stuff in it.
lfvpCO
@lfvpCO
May 15 2018 05:20 UTC
i will check it now
but I think it is more front end stuff than backend.. i jusn need to print the resul of a function on a new page.
Claudio Restifo
@Marmiz
May 15 2018 05:34 UTC
@lfvpCO even tho in theory sounds easy, there are many restrictions imposed by browser about scripts opening new windows ( actually just tabs) on your behalf.
In this case you can make it work pretty easily, but for more complicated stuff better use a backend strategy.
Markus Kiili
@Masd925
May 15 2018 05:35 UTC
@lfvpCO By injecting, @Marmiz means something like:
var opened = window.open("");
opened.document.write("<html><head><title>MyTitle</title></head><body>test</body></html>");
lfvpCO
@lfvpCO
May 15 2018 05:36 UTC
thanks you guys.. I am checking evething
Claudio Restifo
@Marmiz
May 15 2018 05:38 UTC
@Masd925 jeh, perhaps injection is not the correct word... how would you define it?
Manipulation?
Markus Kiili
@Masd925
May 15 2018 05:39 UTC
@Marmiz Write, put content, ... only imagination holds you down here :sparkles:
Claudio Restifo
@Marmiz
May 15 2018 05:39 UTC
do stuff with computer
lfvpCO
@lfvpCO
May 15 2018 06:15 UTC
i used windows.open
Danny Chan
@chandanny
May 15 2018 09:01 UTC
Hello
Do anyone has Google mobile sites or AdWords certificate?
tundeiness
@tundeiness
May 15 2018 10:09 UTC
can anyone help me with a simple explanation on using hasOwnProperty() and Object.keys().. No MDN docs please...they make it even more complicated.
Ahmedur Rahman Shovon
@arsho
May 15 2018 10:40 UTC
hi @tundeiness , what have you tried so far? have any snippets that you found hard to understand? :)
tundeiness
@tundeiness
May 15 2018 11:15 UTC
@arsho MDN so far and I dare say it's a bit tricky.
Daniel Simeonov
@dbsimeonov
May 15 2018 11:18 UTC
Guys is there any trick of the following: Array with n items and on page to display only 9, where the following to create new page for them? I mean do I need to create each of them as different page in my html or there is a way to do that thru js?
Pieter Stokkink
@forkerino
May 15 2018 11:39 UTC
@tundeiness
let o = {}
o.hasOwnProperty('key') // => false
o.key = 'value'
o.hasOwnProperty('key') // => true
Object.keys(o) // => ['key']
tundeiness
@tundeiness
May 15 2018 11:56 UTC
@forkerino thanks sir..
CamperBot
@camperbot
May 15 2018 11:56 UTC
tundeiness sends brownie points to @forkerino :sparkles: :thumbsup: :sparkles:
:star2: 2997 | @forkerino |http://www.freecodecamp.org/forkerino
Danny Chan
@chandanny
May 15 2018 14:07 UTC
hello
do namecheap is good to buy a domain name?
Dhaval Vira
@dhavalveera
May 15 2018 14:08 UTC
everyone have their Own Price
Danny Chan
@chandanny
May 15 2018 14:08 UTC
they have ssl certificates and its only 9 for year. but godaddy charge 50 for a year
Dhaval Vira
@dhavalveera
May 15 2018 14:09 UTC
it depends which service they need
Danny Chan
@chandanny
May 15 2018 14:10 UTC
i only need a domain name with ssl
so namecheap is more competitive
do you have any suggestions?
Dhaval Vira
@dhavalveera
May 15 2018 14:12 UTC
i can't commenr for NameCheap
Danny Chan
@chandanny
May 15 2018 14:18 UTC
i see. thank you
i guess NameCheapis good option if i need ssl
Ramesh
@rnallu
May 15 2018 14:19 UTC
guys, help with json call.
json call, i want to display the default quote first and next onwards on button click. Here's my code.
    $("button").on(click, function(e){
            $.getJSON("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(a) {
              $("body").html(a[0].content + "<p>&mdash; " + a[0].title + "</p>");
              $.ajaxSetup({cache:false});
        });
    });
Christopher McCormack
@cmccormack
May 15 2018 14:21 UTC
@rnallu I believe changing your html will remove your button, is that what you're seeing?
@chandanny you can get ssl for free with Let's Encrypt if you want. Domain name registration and hosting are two different things, and hosting is where you would add your ssl certs
Ramesh
@rnallu
May 15 2018 14:22 UTC
@cmccormack nope, its getting data only when i click button. But i want the page to display the first quote without clicking any. like default
Christopher McCormack
@cmccormack
May 15 2018 14:24 UTC
@rnallu your callback can be moved outside of your button click handler hand used multiple times
function(e) can be moved outside as getQuote(e) or whatever
Or you can look into IIFE
Ramesh
@rnallu
May 15 2018 14:27 UTC
@cmccormack thanks
CamperBot
@camperbot
May 15 2018 14:27 UTC
rnallu sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1450 | @cmccormack |http://www.freecodecamp.org/cmccormack
Nate Mallison
@NJM8
May 15 2018 15:07 UTC
@chandanny Buy a cheap domain from namecheap but do not use them for ssl, use cloudflare as a go between. Cloudflare basically takes all your content and puts it on their CDN and routes all traffic there. They provide Free SSL for all domains and subdomains on their free accounts.
Also Github pages just started supporting SSL for all pages so you may not even need to get it from namecheap
tundeiness
@tundeiness
May 15 2018 15:07 UTC
@ndburrus thanks mate
CamperBot
@camperbot
May 15 2018 15:07 UTC
tundeiness sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:star2: 2219 | @ndburrus |http://www.freecodecamp.org/ndburrus
Nate Mallison
@NJM8
May 15 2018 15:08 UTC
namecheap is too expensive for SSL, just one domain is like $8 but if you want sub domains then it's like $80 for the wildcard SSL
Kudzu
@czhower
May 15 2018 15:14 UTC
letsencrypt - Free SSL!

Most hosts now offer free SSL for domains hosted there. I know BlueHost (sucky, strongly recommend against), and A2 (highly recommend) do. And if not, then just go here for free ones:

https://letsencrypt.org/

Jason Luboff
@JLuboff
May 15 2018 15:17 UTC
:wave: morning
Christopher McCormack
@cmccormack
May 15 2018 15:18 UTC
@JLuboff heya!
Jason Luboff
@JLuboff
May 15 2018 15:18 UTC
@cmccormack How was Phx
Christopher McCormack
@cmccormack
May 15 2018 15:19 UTC
Pretty nice, stayed until last night now back in Flag. Beautiful up here right now as well
How was your weekend?
Kudzu
@czhower
May 15 2018 15:20 UTC
@JLuboff I've always been curious - if you dont want to reply thats fine. Your last name though - has anyone ever told you it is the word for "love" in Russian? Its not a Russian spelling of course and depends on how one accents the syllables though.
Jason Luboff
@JLuboff
May 15 2018 15:22 UTC
@cmccormack Not too bad. Spent it with family on saturday, and then the day for my wife on sunday
Christopher McCormack
@cmccormack
May 15 2018 15:22 UTC
@JLuboff did you force the baby to make breakfast for her?
Jason Luboff
@JLuboff
May 15 2018 15:22 UTC
@czhower I am aware of that, ya. Someone once told me its I think a German spelling of the Russian word>?
Kudzu
@czhower
May 15 2018 15:23 UTC
Yeah, that seems like it could explain it. Its not a Russian last name though, just matches a word in Russian.
I'm ethnically mostly German, my wife is Russian and we lived in Russia for several years.
Jason Luboff
@JLuboff
May 15 2018 15:25 UTC
@cmccormack Haha, nah but I did make her breakfast. Sweet potato hash with sausage. She can't have any egg so... little limited on breakfast items heh
Christopher McCormack
@cmccormack
May 15 2018 15:25 UTC
wow I can't imagine not being able to have eggs
But that was nice of you :)
Jason Luboff
@JLuboff
May 15 2018 15:25 UTC
@czhower I know I have Russian background just not sure to what extent/how far back. Overall, I think I'm mainly eastern european background (polish/russian/etc)
@cmccormack Ya...makes it tough going out to breakfast. She can have egg, but baby boy is allergic so he has reactions to it :(
Kudzu
@czhower
May 15 2018 15:27 UTC
@JLuboff It might be Polish. Polish shares a lot with Russian but uses Latin characters instead. The softer f instead of the v seems Polish to me too.
Christopher McCormack
@cmccormack
May 15 2018 15:28 UTC
@JLuboff well at least that's temporary for her, sucks for him though
Kudzu
@czhower
May 15 2018 15:29 UTC
Might be Russian after all:
image may show up someday.. gitter is laggy for me
Jason Luboff
@JLuboff
May 15 2018 15:30 UTC
Honestly, I'm not even too sure. I really should look into my family history more.. (I know my grandparents were all born in the US, but at least on my mom's side I think great-grandparents were born in Europe?)
@cmccormack Its something that he'll hopefully grow out of
Christopher McCormack
@cmccormack
May 15 2018 15:31 UTC
@JLuboff nature doesn't want babies eating babies? :grinning:
Jason Luboff
@JLuboff
May 15 2018 15:32 UTC
I might be completely off...and obiviousily don't know the biology behind chickens...but aren't the eggs we eat non-fertilized?
Kudzu
@czhower
May 15 2018 15:32 UTC
I believe so.
Christopher McCormack
@cmccormack
May 15 2018 15:33 UTC
@JLuboff that's correct but nature don't care!
Jason Luboff
@JLuboff
May 15 2018 15:33 UTC
haha
Kudzu
@czhower
May 15 2018 15:33 UTC
my brother calls them chicken abortions - not accurate either.
Christopher McCormack
@cmccormack
May 15 2018 15:33 UTC
I told that to a vegetarian co-worker a while ago and it blew her mind, she had no idea
Jason Luboff
@JLuboff
May 15 2018 15:34 UTC
Lol.. chicken abortions.. I mean I probably shouldn't laugh...but I did
I find Vegetarians aren't always the most informed...but the same could be said of me with certain food
Christopher McCormack
@cmccormack
May 15 2018 15:36 UTC
That's where vegans have an advantage :) easier to delineate
Jason Luboff
@JLuboff
May 15 2018 15:38 UTC
:D
What're you working on today?
Christopher McCormack
@cmccormack
May 15 2018 15:40 UTC
Everything haha shaping up to be busy - more work on templates are needed, finally made progress on our new Internet VPN Concentrator build, and updating documentation
you?
Jason Luboff
@JLuboff
May 15 2018 15:41 UTC
Possible setup a computer for an individual (I have several to do but waiting on video cables). Keep on going with my project (setting up all the emailing now)
Christopher McCormack
@cmccormack
May 15 2018 15:42 UTC
oh fun! Does that mean you're almost done?
Bjorn van de Peut
@bjorno43
May 15 2018 15:43 UTC
:wave:
Jason Luboff
@JLuboff
May 15 2018 15:43 UTC
Ya I think I'm getting close. I'll have to show it off soon and get opinions on if its what they want or what needs changing but I'd say Beta is almost done heh
Christopher McCormack
@cmccormack
May 15 2018 15:47 UTC
@bjorno43 heya
@JLuboff awesome man that should be a great notch in your belt once completed
Bjorn van de Peut
@bjorno43
May 15 2018 15:48 UTC
@cmccormack Yo, how you doing m8?
Christopher McCormack
@cmccormack
May 15 2018 15:51 UTC
@bjorno43 doing great! Lots of work to do (good thing) and just started another FCC project so excited to work on that this evening :)
Bjorn van de Peut
@bjorno43
May 15 2018 15:51 UTC
Cool!
Christopher McCormack
@cmccormack
May 15 2018 15:52 UTC
How about yourself?
Bjorn van de Peut
@bjorno43
May 15 2018 15:53 UTC
Not too much right now. I'm having a bit of fun with PhaserJS, but can't rly motivate myself to fully get into it again
Jason Luboff
@JLuboff
May 15 2018 15:54 UTC
@cmccormack Yup...and already additional projects in the horizon
Christopher McCormack
@cmccormack
May 15 2018 15:55 UTC
@bjorno43 that looks really fun
Jason Luboff
@JLuboff
May 15 2018 15:56 UTC
I'm pretty sure @AdelMahjoub used Phaser for his game
Bjorn van de Peut
@bjorno43
May 15 2018 15:56 UTC
@cmccormack Ye, but I'm much more interested in learning ThreeJS. It's just that everytime I dive into 3D Game Development I end up with a very nasty headache, lol
Christopher McCormack
@cmccormack
May 15 2018 16:01 UTC
@bjorno43 haha why is that? fun at first then you realize how much there is to do?
Bjorn van de Peut
@bjorno43
May 15 2018 16:14 UTC
@cmccormack Nah. The maths man.. the maths.. 3D games are no joke :laughing:
Christopher McCormack
@cmccormack
May 15 2018 16:19 UTC
@bjorno43 yeah I've done a small amount of work with gaming and it's extremely math heavy. I guess that's why game engines exist :)
Norvin Burrus
@ndburrus
May 15 2018 17:17 UTC
@tundeiness you're welcome! enjoy :sparkles:
Brad
@bradtaniguchi
May 15 2018 17:23 UTC
I gave up trying to make games once I had to deal with a Quaternion XD
Jason Luboff
@JLuboff
May 15 2018 17:26 UTC
Quaternion sounds fancy
Brad
@bradtaniguchi
May 15 2018 17:31 UTC
something as simple as having one 3d model "face" another 3d model dynamically makes you deal with a whole bunch of fancy physics/thinking. Blew my mind
Jason Luboff
@JLuboff
May 15 2018 17:32 UTC
I'm decent at math...but horrible at physics heh
Markus Kiili
@Masd925
May 15 2018 17:49 UTC
@JLuboff ...hmm...physics.
Jason Luboff
@JLuboff
May 15 2018 17:50 UTC
@Masd925 I know you love physics
Markus Kiili
@Masd925
May 15 2018 17:51 UTC
@JLuboff Don't know about :heart: , but I have studied it a lot in my time.
I think that I like math and nowadays coding more than physics.
Jason Luboff
@JLuboff
May 15 2018 17:52 UTC
Well..I guess @Blauelf is the true physics lover
Brad
@bradtaniguchi
May 15 2018 17:58 UTC
barf
Markus Kiili
@Masd925
May 15 2018 17:59 UTC
@JLuboff Is it because he hates sorting, and in physics, nothing is ever sorted, (except in lottery, but an exception strengthens a law).
Jason Luboff
@JLuboff
May 15 2018 17:59 UTC
...I dunno. I seem to recall he is a physicists is all lol
Markus Kiili
@Masd925
May 15 2018 18:00 UTC
@JLuboff I took up coding because I hated it least of all job fields. Hate is a good motivator.
Jason Luboff
@JLuboff
May 15 2018 18:01 UTC
:joy:
Markus Kiili
@Masd925
May 15 2018 18:03 UTC
@JLuboff 20 years ago I said I would rather clean floors than code. That is how life goes...dum di di dum.
Jason Luboff
@JLuboff
May 15 2018 18:05 UTC
Heh
Brad
@bradtaniguchi
May 15 2018 18:18 UTC
Hmm 20 years ago I was just saying my abcs :P
Jason Luboff
@JLuboff
May 15 2018 18:21 UTC
20 years ago... I was... learning multiplication
Blauelf
@Blauelf
May 15 2018 19:36 UTC
Quaternions are fun :) (we did that in "CS for physicists" as an example how C++ classes work, overloading operators and so on)
Brad
@bradtaniguchi
May 15 2018 22:53 UTC
omg I finally broke thru on the hell that was dealing with a drag and drop library to do my bidding
Jason Luboff
@JLuboff
May 15 2018 22:53 UTC
:+1:
Good job
Although your boss is probably saying "Took you long enough"
Brad
@bradtaniguchi
May 15 2018 22:55 UTC
He was like "just use the other one, should be easy" and I was like, NOPE, gotta use this one cuse the other one is wack AF. Then proceeded to bash my head for half a day
Jason Luboff
@JLuboff
May 15 2018 22:56 UTC
Sounds like a blast
Brad
@bradtaniguchi
May 15 2018 22:59 UTC
It drove me to a point to look into making my own drag and drop lib
Jason Luboff
@JLuboff
May 15 2018 23:00 UTC
Whats it for?
Brad
@bradtaniguchi
May 15 2018 23:02 UTC
Im doing a "builder" module where you can drag items into a card, so you can customize something. The lib we were using is kinda funky in that the idea of "sortable" items and "draggable" items are kinda split, and I ran into the issue of dragging an item into the card ontop of an item wasn't working. (it wouldn't drop)
Jason Luboff
@JLuboff
May 15 2018 23:03 UTC
Ah
Brad
@bradtaniguchi
May 15 2018 23:05 UTC
The lib were using has examples, but the demo doesn't work, and they haven't touched the code for like 6 months. I was thinking about wrapping this lib with angular bindings: https://github.com/Shopify/draggable
since there is already one for dragula, and the documentation for draggable is pretty damn good
Jason Luboff
@JLuboff
May 15 2018 23:07 UTC
mmmhm yes yes
Brad
@bradtaniguchi
May 15 2018 23:16 UTC
finally have a good idea of a lib haha
Jason Luboff
@JLuboff
May 15 2018 23:25 UTC
I have a good idea of my own application (nah..thats a lie)
Brad
@bradtaniguchi
May 15 2018 23:34 UTC
all my ideas suck, i just want an excuse to use new tech hehe
Jason Luboff
@JLuboff
May 15 2018 23:40 UTC
Well its a work project that I'm working on but...ehhhhhh
I'm kind of going with the flow and learning as I go lol
I think I'm actually getting close to finishing..
Brad
@bradtaniguchi
May 15 2018 23:48 UTC
thats always good, I mean I still have my personal project I need to "finish" so idk if starting on a lib wrapper is the best idea haha
Jason Luboff
@JLuboff
May 15 2018 23:50 UTC
I don't have time for personal projects... I guess I could work on something for an hour after the baby goes to bed but..by then I just want to work on hobbies or games or chill hah
Brad
@bradtaniguchi
May 15 2018 23:55 UTC
Yea I mean my hobby nowadays is either games (kerbal space program yo) or my personal projects, but i have a good 2 hours or so in the late night
Jason Luboff
@JLuboff
May 15 2018 23:59 UTC
I don't really have a game of choice (I've only been playing maybe once every 2 weeks hah) but ya.. time is a little more precious now
Any who..time to go home. See ya
Brad
@bradtaniguchi
May 15 2018 23:59 UTC
See ya