These are chat archives for FreeCodeCamp/HelpFrontEnd

23rd
Apr 2017
Czpl
@Czpl
Apr 23 2017 00:09
done!
thenks for suggestions
thanks*
Jorge
@OrangeKulture
Apr 23 2017 00:13
hey guys .. whats cracking?
Czpl
@Czpl
Apr 23 2017 00:14
buttfor
Jorge
@OrangeKulture
Apr 23 2017 00:14
@JulienDemarque what seems to be the prob?
blueboy121
@blueboy121
Apr 23 2017 00:33
Why do none of the following work when I'm making JSON requests from the openweathermap?
  $.ajax({
    url: weatherUrl,
    // The name of the callback parameter, as specified by the YQL service
    jsonp: "callback",
    // Tell jQuery we're expecting JSONP
    dataType: "jsonp",
    // Work with the response
    success: function(response) {
      console.log(response); // server response
    }
  });
$.getJSON(weatherUrl, function(json) {
    console.log(json);
  });*
Jorge
@OrangeKulture
Apr 23 2017 00:35
@blueboy121 u need to specify the type of request
type: "GET",
Saboor Malik
@MathematicsCoding
Apr 23 2017 00:35
@OrangeKulture :wave:
Do you have twitch account?
blueboy121
@blueboy121
Apr 23 2017 00:38
It still doesn't work :(
  $.ajax({
    url: weatherUrl,
    // The name of the callback parameter, as specified by the YQL service
    jsonp: "callback",
    // Tell jQuery we're expecting JSONP
    dataType: "jsonp",
    // Work with the response
    type: GET,
    success: function(response) {
      console.log(response); // server response
    }
  });
Saboor Malik
@MathematicsCoding
Apr 23 2017 00:38
Have you checked your console?
blueboy121
@blueboy121
Apr 23 2017 00:39
When I go to the "weatherUrl" in my browser it comes back with the correct json that I want but the console.log doesn't print anything in my code
@MathematicsCoding Yes I tested the console before this jQuery and it works
Saboor Malik
@MathematicsCoding
Apr 23 2017 00:41
why do you have two jQuery links in your JS setting?
@SkyCoder01 you on?
Jorge
@OrangeKulture
Apr 23 2017 00:43
@MathematicsCoding hey dude.. all good?
Saboor Malik
@MathematicsCoding
Apr 23 2017 00:43
@OrangeKulture yeah have you done twitch app?
Jorge
@OrangeKulture
Apr 23 2017 00:43
havent done the twitch thing ..
Saboor Malik
@MathematicsCoding
Apr 23 2017 00:43
rip...
Anyway just take a look
One profile picture doesnt exist if it does I dont know how to make it blank you know?
Like one picture with question mark
Jorge
@OrangeKulture
Apr 23 2017 00:44
@blueboy121 get has to be with quote marks "GET"
Saboor Malik
@MathematicsCoding
Apr 23 2017 00:45
@keonsam you there?
Jorge
@OrangeKulture
Apr 23 2017 00:45
for ex, this is my ajax for the wiki api:
$.ajax({
        url: url,
        type: "GET",
        async: false,
        dataType: "json",
        success: function(data, status, jqXHR) {
      // do some magic here
}
blueboy121
@blueboy121
Apr 23 2017 00:46
@MathematicsCoding Do you mean the $.ajax and $.getJSON? getJSON wasn't working so I tried .ajax and that doesn't work either
Saboor Malik
@MathematicsCoding
Apr 23 2017 00:46
No I meant the link in your JS setting
Like how you added font awesome to CSS setting
Why did you have two jQuery link?
blueboy121
@blueboy121
Apr 23 2017 00:46
Oh I see what you're saying. I dunno I just added both of them from the list. Should I remove one?
Saboor Malik
@MathematicsCoding
Apr 23 2017 00:47
I think so If needed
blueboy121
@blueboy121
Apr 23 2017 00:48
@OrangeKulture : sorry about that! I fixed it to say "GET" but it still doesn't do anything.
gulptech
@gulptech
Apr 23 2017 00:54
@blueboy121 openweathermap does not work with https
use a different api..i used darksky and wUnderground
Saboor Malik
@MathematicsCoding
Apr 23 2017 00:56
darksky is better choice
Aaron P
@MutinE
Apr 23 2017 00:56
Can someone help me figure out why my timer isn't counting down correctly?https://codepen.io/apeck14/pen/eWZVjO?editors=0011
Thank you.
blueboy121
@blueboy121
Apr 23 2017 00:59
@gulptech @MathematicsCoding thanks!
CamperBot
@camperbot
Apr 23 2017 00:59
blueboy121 sends brownie points to @gulptech and @mathematicscoding :sparkles: :thumbsup: :sparkles:
:cookie: 337 | @mathematicscoding |http://www.freecodecamp.com/mathematicscoding
:cookie: 302 | @gulptech |http://www.freecodecamp.com/gulptech
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:00
No problem
Aaron P
@MutinE
Apr 23 2017 01:02
@MathematicsCoding @gulptech can either of you help me quick?
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:02
@MutinE Sorry Im not there yet
Tyler Collins
@tjscollins
Apr 23 2017 01:04
@MutinE You never update the value of now
@MutinE You need to set the value of now inside the function being executed every second
Aaron P
@MutinE
Apr 23 2017 01:04
@tjscollins good point, thank you.
CamperBot
@camperbot
Apr 23 2017 01:04
mutine sends brownie points to @tjscollins :sparkles: :thumbsup: :sparkles:
:cookie: 346 | @tjscollins |http://www.freecodecamp.com/tjscollins
Aaron P
@MutinE
Apr 23 2017 01:06
@tjscollins it still doesn't work
Tyler Collins
@tjscollins
Apr 23 2017 01:06
@MutinE Don't change nowPlusX
@MutinE that should be constant
if you're updating both every second then the interval between them never decreases
Aaron P
@MutinE
Apr 23 2017 01:08
@tjscollins Ok, but if I take nowPlusX out of the interval function then the scope is off
because its using the updated now to calculate
Tyler Collins
@tjscollins
Apr 23 2017 01:09
Declare now before the callback. then update it inside the callback
like this
    //miliseconds since Jan 1 + x amount of mins
    var nowPlusX = new Date(now + (displayMins*60*1000));
    var now = new Date().getTime();

//start the countdown
$("#textCen").click(function(){
  //function to run every second
  var timeInterval = setInterval(function(){

    //miliseconds since Jan 1
    now = new Date().getTime();

    //difference in miliseconds (5 mins...diffMins = 300,000)
    var differenceMS = nowPlusX - now;
    //diff of mins
    var minutes = Math.floor((differenceMS % (1000 * 60 * 60)) / (1000 * 60));
    //diff of seconds
    var seconds = Math.floor((differenceMS % (1000 * 60)) / 1000);

    console.log(seconds);

    $("#textCen").html(minutes+":"+seconds);

  },1000);
});
Aaron P
@MutinE
Apr 23 2017 01:10
var nowPlusX = new Date(new Date().getTime() + (displayMins*60*1000)); will this work the same?
Tyler Collins
@tjscollins
Apr 23 2017 01:10
yes
Aaron P
@MutinE
Apr 23 2017 01:10
Ok, thanks a lot man. Appreciate the help
blueboy121
@blueboy121
Apr 23 2017 01:11
@gulptech @MathematicsCoding Guys I switched over to darksky but I still get nothing back any ideas?
Tyler Collins
@tjscollins
Apr 23 2017 01:12
@MutinE You should probably move the declaration of nowPlusX inside the click handler though. Otherwise you'll notice the timer starting at something like 4:55 instead of 5:00
blueboy121
@blueboy121
Apr 23 2017 01:12
When i enter the url into my browser it returns json like it's supposed to but I get nothing in the console for "response"
Jorge
@OrangeKulture
Apr 23 2017 01:13
@blueboy121 if you get a response in the browser or in Postman, but you don't in codepen, it means you have a CORS issue, most likely .. this is , you are requesting a response over http, when it only works with https
Moisés Man
@moigithub
Apr 23 2017 01:14
@blueboy121 open ur browser devtools and check on console if u have any errors
Aaron P
@MutinE
Apr 23 2017 01:14
@tjscollins wait wdym?
Can you show me?
Tyler Collins
@tjscollins
Apr 23 2017 01:16
@MutinE
//start the countdown
$("#textCen").click(function(){
//miliseconds since Jan 1 + x amount of mins
    var nowPlusX = new Date(new Date().getTime() + (displayMins*60*1000));

  //function to run every second
  var timeInterval = setInterval(function(){

    //miliseconds since Jan 1
    var now = new Date().getTime();

    //difference in miliseconds (5 mins...diffMins = 300,000)
    var differenceMS = nowPlusX - now;
    //diff of mins
    var minutes = Math.floor((differenceMS % (1000 * 60 * 60)) / (1000 * 60));
    //diff of seconds
    var seconds = Math.floor((differenceMS % (1000 * 60)) / 1000);

    console.log(seconds);

    $("#textCen").html(minutes+":"+seconds);

  },1000);
blueboy121
@blueboy121
Apr 23 2017 01:16
@moigithub So I found this error in the console: XMLHttpRequest cannot load https://api.darksky.net/forecast/7ebde8621c751713b121af3174dc4ed9/39.1328314,-77.1887804?units=si. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://s.codepen.io' is therefore not allowed access.
Tyler Collins
@tjscollins
Apr 23 2017 01:16
Even then it's still not right. The display starts counting down at 4:59, but it's better. Before you were setting your stop time at pageload you really want to set it when you click to start the timer.
@blueboy121 Set your dataType to jsonp, not json
JD Tadlock
@jdtdesigns
Apr 23 2017 01:17
@blueboy121 You need to return jsonp from the api
Aaron P
@MutinE
Apr 23 2017 01:17
@tjscollins Alright, thanks.
CamperBot
@camperbot
Apr 23 2017 01:17
mutine sends brownie points to @tjscollins :sparkles: :thumbsup: :sparkles:
:warning: mutine already gave tjscollins points
blueboy121
@blueboy121
Apr 23 2017 01:19
@tjscollins @jdtdesigns Yes jsonp fixed it! thanks
CamperBot
@camperbot
Apr 23 2017 01:19
blueboy121 sends brownie points to @tjscollins and @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 347 | @tjscollins |http://www.freecodecamp.com/tjscollins
:cookie: 915 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
blueboy121
@blueboy121
Apr 23 2017 01:19
But what is jsonp and where should it be used?
Mohamed Derhalli
@derhallim
Apr 23 2017 01:20
@MathematicsCoding wassup
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:20
@derhallim here
Mohamed Derhalli
@derhallim
Apr 23 2017 01:21
ok
what about t?\
Aaron P
@MutinE
Apr 23 2017 01:21
@tjscollins i changed Math.floor to Math.round for my seconds conversion and it works properly now.
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:21
See one of profile picture?
One of them doesnt have it
So is there like an error picture with question mark?
Tyler Collins
@tjscollins
Apr 23 2017 01:22

@blueboy121 http://stackoverflow.com/questions/3839966/can-anyone-explain-what-jsonp-is-in-layman-terms

Basically, it's a hack to get around the problem that @OrangeKulture mentioned. Ajax isn't really meant to send requests to OTHER domains, and browsers generally block it for security reasons.

Mohamed Derhalli
@derhallim
Apr 23 2017 01:22
u can have default placeholder
Tyler Collins
@tjscollins
Apr 23 2017 01:23
So, use it anytime you're using Ajax to get stuff from a different domain than the one your site is on. Your own site, use json.
Mohamed Derhalli
@derhallim
Apr 23 2017 01:24
@MathematicsCoding
Moisés Man
@moigithub
Apr 23 2017 01:24
server MUST allow cross domain request (pass some special headers)
else ur browser will complain @blueboy121
then u need to use jsonP request to bypass that restriction
Mohamed Derhalli
@derhallim
Apr 23 2017 01:24
i added the codepen avatar as the default logo
Mohamed Derhalli
@derhallim
Apr 23 2017 01:24
check my pen
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:24
Oh I see
Mohamed Derhalli
@derhallim
Apr 23 2017 01:25
:thumbsup:
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:27
What am I doing wrong...
Mohamed Derhalli
@derhallim
Apr 23 2017 01:27
@MathematicsCoding refresh the pen again, see how am using es6 syntax to concatenate the strings
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:27
oh I didnt see it :\
it works thanks @derhallim
CamperBot
@camperbot
Apr 23 2017 01:28
mathematicscoding sends brownie points to @derhallim :sparkles: :thumbsup: :sparkles:
:cookie: 263 | @derhallim |http://www.freecodecamp.com/derhallim
Mohamed Derhalli
@derhallim
Apr 23 2017 01:28
:thumbsup:
Tyler Collins
@tjscollins
Apr 23 2017 01:31
@MutinE Looks good now. Though, I would suggest setting the interval time to less than a second then, like 100 ms. That way you don't get any weirdness like accidentally skipping a second on the display if the 1000ms + wait + execution overhead takes too long
What do you think?
lol my weather app already have 200+ views
ExplorerT
@ExplorerT
Apr 23 2017 01:35
Hey guys, I just finished my portfolio page but not sure of the colours I used. Any suggestions or comments? https://codepen.io/explorert/full/gWMLBX/
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:36
@ExplorerT Your name is Tolua or Tolu?
Just looking for typos
Looks perfect
Mohamed Derhalli
@derhallim
Apr 23 2017 01:39
@ExplorerT change the background color on active navigations
@MathematicsCoding make ul css list style none
ExplorerT
@ExplorerT
Apr 23 2017 01:41
@MathematicsCoding Thanks! My name is Tolu I just added the first letter of my lastname :smile:
CamperBot
@camperbot
Apr 23 2017 01:41
explorert sends brownie points to @mathematicscoding :sparkles: :thumbsup: :sparkles:
:cookie: 339 | @mathematicscoding |http://www.freecodecamp.com/mathematicscoding
Mohamed Derhalli
@derhallim
Apr 23 2017 01:41
ul { list-style-type : none }
@MathematicsCoding ^
ExplorerT
@ExplorerT
Apr 23 2017 01:42
@derhallim Thanks! I will work on nav item background colour.
CamperBot
@camperbot
Apr 23 2017 01:42
explorert sends brownie points to @derhallim :sparkles: :thumbsup: :sparkles:
:cookie: 264 | @derhallim |http://www.freecodecamp.com/derhallim
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:43
@derhallim why?
Mohamed Derhalli
@derhallim
Apr 23 2017 01:44
to remove the circle to the left of images
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:45
AH
Where do I add it?
Mohamed Derhalli
@derhallim
Apr 23 2017 01:45
the default html li thing
put it in css
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:45
CSS of course :joy:
Mohamed Derhalli
@derhallim
Apr 23 2017 01:45
yesssss
:trollface:
Anybody know why my .hide() calls aren't working?
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:45
thanks again
@pae4557 nice personal project
@derhallim why didnt you make any projects?
Mohamed Derhalli
@derhallim
Apr 23 2017 01:48
i did
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:48
I dont see one on your profile
Mohamed Derhalli
@derhallim
Apr 23 2017 01:49
that's my project :P
it
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:49
...
Mohamed Derhalli
@derhallim
Apr 23 2017 01:49
it's a website to show my app
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:49
alright
Dang its amazing
Personal project only?
Mohamed Derhalli
@derhallim
Apr 23 2017 01:51
it has 3000 downloads so far
it converts excel sheets to charts
using JS
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:51
ah
You created it?
Mohamed Derhalli
@derhallim
Apr 23 2017 01:51
yea
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:52
Well why didnt you add it to your profile?
How would fCC see it :\
Mohamed Derhalli
@derhallim
Apr 23 2017 01:52
who cares about fcc
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:52
You dont?
Mohamed Derhalli
@derhallim
Apr 23 2017 01:52
nope
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:52
I see
Mohamed Derhalli
@derhallim
Apr 23 2017 01:52
i just come here to discuss js
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:52
Interesting
Just saying
I gotta change my profile picture..
Mohamed Derhalli
@derhallim
Apr 23 2017 01:53
to what?
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:53
No idea
To reveal my real face?
Nah :\
Mohamed Derhalli
@derhallim
Apr 23 2017 01:54
nah, my eyes already hurt
:P
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:54
lol
Mohamed Derhalli
@derhallim
Apr 23 2017 01:54
i'll brb
did u watch that long debate
:joy:
that was so fun
Mohamed Derhalli
@derhallim
Apr 23 2017 01:55
it was like 2 hours debate
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:55
yeah lol
lol I remember this
I used to do it on khanacademy
Mohamed Derhalli
@derhallim
Apr 23 2017 01:57
is khanacademy gd?
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:57
Yeah it says for kid but looks a bit advanced
I didnt like it too easy
Mohamed Derhalli
@derhallim
Apr 23 2017 01:57
what did u study there?
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:57
Just how to draw shapes and animation lol
Mohamed Derhalli
@derhallim
Apr 23 2017 01:58
ah that's cool
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:58
I forgot how to do animation...
Mohamed Derhalli
@derhallim
Apr 23 2017 01:58
css 3
or greensock
Saboor Malik
@MathematicsCoding
Apr 23 2017 01:58
Dunno
Mohamed Derhalli
@derhallim
Apr 23 2017 01:59
check my friend's tool: http://alertifyjs.com
try to play with the alerts inside
Saboor Malik
@MathematicsCoding
Apr 23 2017 02:00
alright
brb :joy:
back :\
lmao
I wanna change my profile pic to that
Kuriakin Zeng
@kuriakinzeng
Apr 23 2017 02:06
lol
old news though
Saboor Malik
@MathematicsCoding
Apr 23 2017 02:07
.
I know its inappropriate but look at this
whoops..
Yo
Saboor Malik
@MathematicsCoding
Apr 23 2017 02:14
Huh I got 2 followers
Jorge
@OrangeKulture
Apr 23 2017 02:18
lol
@MathematicsCoding *enjoys the fame
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:24
var myColor="White"
myColor.length
this is right?
Jorge
@OrangeKulture
Apr 23 2017 02:25
yup
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:26
lol
but is not working
i think that is a bug
says that i dont show de length of the var in the console
Jorge
@OrangeKulture
Apr 23 2017 02:27
it should print 5
@Karumba15 what challenge are u on?
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:27
i am not learnig javascript here in the FCC yet
learning"
i learning the really basics at codeacademy
Jorge
@OrangeKulture
Apr 23 2017 02:28
ohh ok .. umm, yeah it's supposed to print 5 tho ..
maybe your code has a typo?
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:28
in the console
shows the number 5
this is what is asked
On line 1, create a variable myColor and assign it a string.
On line 2, it displays the length of myColor no console.
Jorge
@OrangeKulture
Apr 23 2017 02:28
ok yeah, so it works, no?
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:29
Yes, but the page says that is not working
look
Oops, try again. It looks like you did not exhibit the length of myColor on the console!
Jorge
@OrangeKulture
Apr 23 2017 02:30
try hitting f5
sometimes codecademy gets stuck and that helps
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:30
alright
Jorge
@OrangeKulture
Apr 23 2017 02:30
ah ok
i know what it is
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:31
the challenges here at the FCC are too hards for me, i dont know a shit about javascript or programming
only html and css
Jorge
@OrangeKulture
Apr 23 2017 02:31
you have to actually call the function to log the info ... if the code is exactly as you pointed out:
var myColor="White"
myColor.length
Kaeleb Rocha
@Kralleb
Apr 23 2017 02:31
Anyone know how to implement the weather api into code? i'm a little lost on how to implement api's
Jorge
@OrangeKulture
Apr 23 2017 02:31
then you need to to call the function
console.log(myColor.length);
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:32
Hmmmmmmmm
that is whyy
thanks @OrangeKulture
CamperBot
@camperbot
Apr 23 2017 02:32
karumba15 sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 326 | @orangekulture |http://www.freecodecamp.com/orangekulture
JD Tadlock
@jdtdesigns
Apr 23 2017 02:32
does it require you to use console.log @Karumba15 ?
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:33
Yes
now worked
Jorge
@OrangeKulture
Apr 23 2017 02:33
@Karumba15 yeah i understand about how these may seem harder. It's actually a good idea to start out with the very very basics, if you have never played around with languages... I do think that the challenges here are not that hard at first, they have a introductory challenges which i think are not as hard
@Kralleb what seems to be the prob?
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:34
@OrangeKulture yeah, i tried the first challenges but was so hard... so i am trying to learn the really basics stuffs about languages, like functions,variables,strings
all is really new to me
Ken Haduch
@khaduch
Apr 23 2017 02:34
@Kralleb - it's been a while since I looked at this video about the weather site implementation. Maybe it will give you some insight?
Jorge
@OrangeKulture
Apr 23 2017 02:35
@Karumba15 ahh ok got it, yeah for sure it's hard at first, that happened to all of us .. You will definitely get some help and good advice here, everyone is really friendly and open to help out
JD Tadlock
@jdtdesigns
Apr 23 2017 02:35
@Karumba15 FCC doesn't hold your hand through the challenges. It's not a learning platform as much a challenge platform
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:37
@OrangeKulture yeah, the guys here help me a loot until now, i learn so much about html and css in a small period of time
lot"
Kaeleb Rocha
@Kralleb
Apr 23 2017 02:37
@khaduch Thanks for that
CamperBot
@camperbot
Apr 23 2017 02:37
kralleb sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2772 | @khaduch |http://www.freecodecamp.com/khaduch
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:37
@jdtdesigns yeah, here is more like learning while you do
Keon Samuel
@keonsam
Apr 23 2017 02:38
:+1:
@Karumba15 What are you working on?
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:38
@keonsam since i started my portfólio page im trying to learn javascript
so i go to codeacademy to learn the really basic stuffs
because here in FCC was to hard for me
i finishe my portfólio page"
Keon Samuel
@keonsam
Apr 23 2017 02:39
nice
snickerz
@snickerz
Apr 23 2017 02:39
http://codepen.io/snickerz/pen/ZeoBJz Can someone help me?? what am I doing wrong? anyone racking my brains
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:40
@keonsam did you know javascript already?
Keon Samuel
@keonsam
Apr 23 2017 02:40
yes
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:40
i think everybody here know hahaha has been veery hard for me to understand
Keon Samuel
@keonsam
Apr 23 2017 02:41
you just need some practice.
Anthony Pierson
@Donald-Tho
Apr 23 2017 02:42
<script>
  var quotes=[["We look forward to the time when the Power of Love will replace the Love of Power. Then will our world know the blessings of peace.","William Ewart Gladstone"],["It is better to remain silent at the risk of being thought a fool, than to talk and remove all doubt of it.","maurice Switzer"],["For success, attitude is equally as important as ability.","anonymous"],["Either you run the day, or the day runs you.","Jim Rohn"],["When I die, I want to go peacefully like my grandfather did–in his sleep. Not yelling and screaming like the passengers in his car.","Bob Monkhouse"],["When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down “happy.” They told me I didn’t understand the assignment, and I told them they didn’t understand life.","anonymous"],["Never doubt that a small group of thoughtful, committed citizens can change the world. Indeed, it’s the only thing that ever has.","Margaret Mead"],["People are illogical, unreasonable, and self-centered. Love them anyway.","Kent M. Keith"],["Absence diminishes mediocre passions and increases great ones, as the wind blows out candles and fans fire.","François (VI) (Duc de La Rochefoucauld)"],["The next time you’re faced with something that’s unexpected, unwanted and uncertain, consider that it just may be a gift.","Stacey Kramer"]];
    $(document).ready(function(){
      $(document).getElementById('#newQuote').onclick = function() {
      $("#Quote").html(quotes[Math.floor(Math.random(0,11))][0]);
      Console.log("Quote loading");
    }
    });
</script>


<link href="https://fonts.googleapis.com/css?family=UnifrakturCook:700" rel="stylesheet">
<div class="container">
  <div class="row">
    <div style="background-color:rgb(255,255,255)">
    <center><h1 style="font-family: 'UnifrakturCook', cursive;color:rgb(0,34,89);">Random Quote Machine</h1></center>
      <div style="border-radius:20px;background-color:rgba(232,232,232,.5);margin:200px;">
        <center><h1 id="Quote"style="font-family: 'UnifrakturCook', cursive;">Placeholder Quote</h1></center>
        <center><button id="newQoute" class="btn btn-primary" style="">Load New Quote</button></center>
      </div>
    </div>
  </div>
</div>
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:42
Yes... Did you guys know another plataform ? to learn javascript starting in the basic?
Jorge
@OrangeKulture
Apr 23 2017 02:42
@Karumba15 don't worry about that, everyone is at different levels .. we were all where u are right now at some point, it's simply a journey .. lot's of practice and you'll bee good soon, if you really want to
Anthony Pierson
@Donald-Tho
Apr 23 2017 02:42
does anyone know why it's not changing the text with id "Quote"
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:43
@OrangeKulture yeah im really want to get good, i hope i can show my progress for you guys very soon
RakeshNerkar
@Rakesh18754
Apr 23 2017 02:43
i have a
function getData(){
    //ONCE THIS GETS THE DATA IS PRESENT IT SHOULD TRIGGER 2 DIFFERENT FUNCTION ie. dataRecievedProcess1 and dataRecievedProcess2
    //I KNOW THAT I HAVE TO USE CALL BACKS BUT CAN ANY ONE GIVE ME SYNTAX OR EXAMPLE
}

function dataRecievedProcess1(){

}

function dataRecievedProcess2(){

}
Jorge
@OrangeKulture
Apr 23 2017 02:44
@Karumba15 u will, just stick to it and everything will become easier over time.
JD Tadlock
@jdtdesigns
Apr 23 2017 02:44
@Karumba15 You'll never stop learning. I'm 7 years in and it never stops. You just have to keep pushing to retain the knowledge you've acquired. Once you have the basics down, the rest is just a retention game.
Ken Haduch
@khaduch
Apr 23 2017 02:44
@Donald-Tho - you are missing a space after id="Quote" for one thing.
Anthony Pierson
@Donald-Tho
Apr 23 2017 02:44
that shouldn't affect anything iirc
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:45
@jdtdesigns yeah i realize that, the basic stuffs are the more hard, after that seems like everything is more easier and simple
JD Tadlock
@jdtdesigns
Apr 23 2017 02:45
@snickerz What are you trying to achieve?
snickerz
@snickerz
Apr 23 2017 02:45
the weather project
Vinicius Otacilio
@Karumba15
Apr 23 2017 02:45
thanks for the help guys @OrangeKulture @jdtdesigns
CamperBot
@camperbot
Apr 23 2017 02:45
karumba15 sends brownie points to @orangekulture and @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: karumba15 already gave orangekulture points
:cookie: 916 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
Ken Haduch
@khaduch
Apr 23 2017 02:46
@Donald-Tho - are you loading jquery.js?
JD Tadlock
@jdtdesigns
Apr 23 2017 02:46
using google location api? @snickerz
snickerz
@snickerz
Apr 23 2017 02:46
@Karumba15 thats right never stop learning and never get rusty either
Jorge
@OrangeKulture
Apr 23 2017 02:46
@Karumba15 sure thing
snickerz
@snickerz
Apr 23 2017 02:46
@jdtdesigns yes
JD Tadlock
@jdtdesigns
Apr 23 2017 02:47
i'm not at home, so it's hard for me to go through the code @snickerz
Anthony Pierson
@Donald-Tho
Apr 23 2017 02:47
I wasn't, but I turned it on but it still doesn't work
JD Tadlock
@jdtdesigns
Apr 23 2017 02:47
what seems to be the issue? @snickerz
snickerz
@snickerz
Apr 23 2017 02:47
wanting to know why the weather stuff does not show up??
Ken Haduch
@khaduch
Apr 23 2017 02:47
@Donald-Tho - check your browser console for errors? Do you have a URL that you can post? Easier than guessing...
Jorge
@OrangeKulture
Apr 23 2017 02:48
@Donald-Tho i think your random is a bit off? maybe im not sure
snickerz
@snickerz
Apr 23 2017 02:48
http://codepen.io/snickerz/pen/ZeoBJz please check it out ok
Jorge
@OrangeKulture
Apr 23 2017 02:48
@Donald-Tho this should work:
quotes[Math.floor(Math.random()*12)][0]
Anthony Pierson
@Donald-Tho
Apr 23 2017 02:48
it says jQuery must be included before javascript. I will see if that fixes it
Ken Haduch
@khaduch
Apr 23 2017 02:50
@snickerz - you are getting an error: "Google Maps API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error Your site URL to be authorized: http://s.codepen.io/boomerang/iFrameKey-fdc2fd22-e986-38ea-91d0-488c59ea75e4/index.html"
JD Tadlock
@jdtdesigns
Apr 23 2017 02:50
@snickerz Seems you might have not added codepen.io to your accepted domains
in the google api console
Aaron P
@MutinE
Apr 23 2017 02:52
@tjscollins just saw your message, and just changed it. Works even better now! Thanks. Also, I have another quick question if you're still on?
CamperBot
@camperbot
Apr 23 2017 02:52
mutine sends brownie points to @tjscollins :sparkles: :thumbsup: :sparkles:
:cookie: 348 | @tjscollins |http://www.freecodecamp.com/tjscollins
snickerz
@snickerz
Apr 23 2017 02:53
@jdtdesigns how do i fix that then????
JD Tadlock
@jdtdesigns
Apr 23 2017 02:53
try recreating the api key @snickerz
Aaron P
@MutinE
Apr 23 2017 02:54
Can someone help me quick? I just can't figure out what to divide on my timer to see the percentage
Ken Haduch
@khaduch
Apr 23 2017 02:55
@Donald-Tho - just loading your code into the HTML panel on CodePen will probably not work, because it puts all of that code into the <body> section. So I moved it into the JS section (the <script> section.) And getting an error: $(document).getElementById is not a function - you are mixing vanilla JS functions with jquery functions. (Which I probably should have noticed before...)
Aaron P
@MutinE
Apr 23 2017 02:57
@khaduch Do you think you can help me out quick?
Should be really quick
Ken Haduch
@khaduch
Apr 23 2017 02:58
@Donald-Tho - and you have misspelled "newQuote" in your HTML on the button id= value.
Anthony Pierson
@Donald-Tho
Apr 23 2017 02:59
what a mess lol. I didn't even see these things before
Aaron P
@MutinE
Apr 23 2017 02:59
My Comodoro Clock is finished but I'm trying to add a feature where the progress bar loads based on the time remaining (percentage), and I can't figure out how to calculate the current percentage. In the last function under console.log() is what I currently have, but it doesn't work. https://codepen.io/apeck14/pen/eWZVjO?editors=0111
Ken Haduch
@khaduch
Apr 23 2017 02:59
@Donald-Tho - and for jquery, you want to use .click() on .onclick
Jorge
@OrangeKulture
Apr 23 2017 03:00
@Donald-Tho what @khaduch said .. also, you can simply use the selector with jquery, no need to get the id with the html .. imo
Ken Haduch
@khaduch
Apr 23 2017 03:01

@Donald-Tho - I changed your code to this:

    $(document).ready(function(){
      $('#newQuote').click(function() {
      $("#Quote").html(quotes[Math.floor(Math.random()*11)][0]);
      console.log("Quote loading");
    });
    });

And it's working. Styling needs some work, and perhaps other cleanup, but that's one way to get it working.

snickerz
@snickerz
Apr 23 2017 03:01
@jdtdesigns is there a api library for free weather reports?
Ken Haduch
@khaduch
Apr 23 2017 03:01
@MutinE - post your question / link to your code. Someone can help, I'll try, some people are faster... :)
Jorge
@OrangeKulture
Apr 23 2017 03:01
@Donald-Tho i would do something like this:
$('#newQuote').on('click',function(){
$("#Quote").text(quotes[Math.floor(Math.random()*11)][0]);
});
Aaron P
@MutinE
Apr 23 2017 03:02
I did^^ @khaduch
Jorge
@OrangeKulture
Apr 23 2017 03:02
also note that Quote is misspelled on your html code
Aaron P
@MutinE
Apr 23 2017 03:02
And ty
Ken Haduch
@khaduch
Apr 23 2017 03:02
@MutinE - sorry, I missed it while looking at other things.
Aaron P
@MutinE
Apr 23 2017 03:03
My Comodoro Clock is finished but I'm trying to add a feature where the progress bar loads based on the time remaining (percentage), and I can't figure out how to calculate the current percentage. In the last function under console.log() is what I currently have, but it doesn't work. https://codepen.io/apeck14/pen/eWZVjO?editors=0111
Anthony Pierson
@Donald-Tho
Apr 23 2017 03:03
@khaduch thank you. I did not want to be the one who gets his code from others but it seems I did not know what was wrong with my code in the first place. I'll try to learn exactly how this works and apply it to other projects so I am not just using your work :)
CamperBot
@camperbot
Apr 23 2017 03:03
donald-tho sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2773 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
Apr 23 2017 03:03
@MutinE - without looking - then I'll look - take the remaining seconds / total seconds times 100 should give you a percentage.
@Donald-Tho - if you're new to using jquery, it's good to have a simple working example that you'll understand quickly. Sorry if I posted a "spoiler"...
JD Tadlock
@jdtdesigns
Apr 23 2017 03:04
@snickerz weatherunderground and quite a few others
Aaron P
@MutinE
Apr 23 2017 03:04
@khaduch Ok ty, I'll see what I can come up with :)
CamperBot
@camperbot
Apr 23 2017 03:04
mutine sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2774 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
Apr 23 2017 03:06
@MutinE - or maybe you want elapsed seconds divided by total seconds times 100 - if you want to count up to 100%
JD Tadlock
@jdtdesigns
Apr 23 2017 03:06
@MutinE The typical pattern is remaining / total * 100
Aaron P
@MutinE
Apr 23 2017 03:06
Yah I'm lost, what I tried didn't work at all.
It logged something like 26354436363E-1
JD Tadlock
@jdtdesigns
Apr 23 2017 03:08
for a percentage indicator it would be total height/width of the indicator * total seconds
for example
Aaron P
@MutinE
Apr 23 2017 03:09
@jdtdesigns Can you take a quick look at my code?
JD Tadlock
@jdtdesigns
Apr 23 2017 03:11
I can't really go through it on my phone lol
Aaron P
@MutinE
Apr 23 2017 03:11
Ok, thanks anyway
Vinicius Otacilio
@Karumba15
Apr 23 2017 03:19
how a incremet a number with js?
my variable is var myVar="87"
var myVar=87;
JD Tadlock
@jdtdesigns
Apr 23 2017 03:19
var num = 0; num++;
Vinicius Otacilio
@Karumba15
Apr 23 2017 03:20
why num++?
JD Tadlock
@jdtdesigns
Apr 23 2017 03:20
Just a shortcut for num + 1;
Aaron P
@MutinE
Apr 23 2017 03:20
or num += 1;, whichever you like better.
JD Tadlock
@jdtdesigns
Apr 23 2017 03:21
+=
Ken Haduch
@khaduch
Apr 23 2017 03:21
@MutinE - do you have that calculation in your project? I'm trying to see what you're doing there. You would probably have an easier time with all of these calculations if you just kept your time value in seconds - none of this conversion to minutes and seconds and all of those calculations. Also, I don't really see the value of using the "Date" to further complicate this problem. I think that using a simple setInterval with 1000 ms as the repeat value is sufficient for this problem, but maybe that's just me.
Anyway - have you put any code in place to calculate the percentage?
JD Tadlock
@jdtdesigns
Apr 23 2017 03:21
Lol so slow on my phone
Vinicius Otacilio
@Karumba15
Apr 23 2017 03:21
myVar has to becode myVar="88"
Aaron P
@MutinE
Apr 23 2017 03:22
@khaduch What I currently have is percent = (differenceMS / nowPlusX) *100;, and it doesn't work.
JD Tadlock
@jdtdesigns
Apr 23 2017 03:22
You're trying to increment a string @Karumba15
Vinicius Otacilio
@Karumba15
Apr 23 2017 03:22
@jdtdesigns yeah
JD Tadlock
@jdtdesigns
Apr 23 2017 03:22
use an integer instead?
snickerz
@snickerz
Apr 23 2017 03:23
@jdtdesigns I am on the weather underground which plan with no money needed??
Aaron P
@MutinE
Apr 23 2017 03:23
@Karumba15 use Number(); to convert it...I believe
Ken Haduch
@khaduch
Apr 23 2017 03:23
@MutinE - I see that now - since you are working with the Date, what values are you getting in your nowPlusX and now variables?
JD Tadlock
@jdtdesigns
Apr 23 2017 03:23
Or Number(myVar)++
Anthony Pierson
@Donald-Tho
Apr 23 2017 03:23
okay, I have a question about bootstrap.
Vinicius Otacilio
@Karumba15
Apr 23 2017 03:24
im at the Increment a Number with JavaScript
challenge
JD Tadlock
@jdtdesigns
Apr 23 2017 03:25
@snickerz weatherunderground is free for 10000 requests a day i believe
Anthony Pierson
@Donald-Tho
Apr 23 2017 03:25
Why in the world does containing something in a row make it left-justified instead of making it centered, or fill the entire screen? even after I added the col-xs-12 class to the div inside the row div, it didn't work, but without the row it works perfectly now.
Aaron P
@MutinE
Apr 23 2017 03:25
@khaduch nowPlusX is now plus however many minutes the user selects to add (in milliseconds), and now is how many milliseconds since Jan 1
Ken Haduch
@khaduch
Apr 23 2017 03:25
@MutinE - oh, nowPlusX is an object... so that's not going to work too well to substract that from a time value. Probably will get garbage.
Aaron P
@MutinE
Apr 23 2017 03:26
It is?
Ken Haduch
@khaduch
Apr 23 2017 03:27
that's what it looks like...
Aaron P
@MutinE
Apr 23 2017 03:27
@khaduch how can I get it to be an int?
Vinicius Otacilio
@Karumba15
Apr 23 2017 03:28
im so stucked omg
Ken Haduch
@khaduch
Apr 23 2017 03:28
@MutinE - looks like you're using .getTime() to get the now value, so try that? The numbers still don't make sense...
Aaron P
@MutinE
Apr 23 2017 03:28
Wait, what do you want me to try?
Anthony Pierson
@Donald-Tho
Apr 23 2017 03:29
@Karumba15 no need to define the variable again. You need to remove the var from before the myVal and set it to itself plus 1.
Jorge
@OrangeKulture
Apr 23 2017 03:29
@Donald-Tho depends on what you are trying to do with boostrap .. do you have some code to look at?
Vinicius Otacilio
@Karumba15
Apr 23 2017 03:32
@Donald-Tho yes i use myVar++
and worked
Ken Haduch
@khaduch
Apr 23 2017 03:32
@MutinE - I don't know what to try at this point. I haven't messed around with the Date() object. Number of milliseconds since January 1, 1970 "does not compute" in my brain. Let me look for a little while.
Aaron P
@MutinE
Apr 23 2017 03:33
@khaduch I did Number(nowPlusX) in the console and it works fine. But the percent is still off
Anthony Pierson
@Donald-Tho
Apr 23 2017 03:34
Ken, I think you should define a variable called startTime when the user first loads the page and set it to the current time. Also make a currentTime and set it to 0. Then when you need to get the time, update the currentTime variable by subtracting the startTime from the raw time you get from .getTime(), or whatever method you use to get the time
Aaron P
@MutinE
Apr 23 2017 03:35
@Donald-Tho Why when the user loads the page?
For startTime
Anthony Pierson
@Donald-Tho
Apr 23 2017 03:38
I guess I didn't understand what you wanted. You could still set startTime at any point and it would start counting up I was saying.
Aaron P
@MutinE
Apr 23 2017 03:40
Has anyone completed the Tic Tac Toe Game? How do you go about creating a "computer" using JS?
Isn't that what ML is for?
JD Tadlock
@jdtdesigns
Apr 23 2017 03:44
You can simply create a random selection based on open slots or go as far as implementing the mini max algorithm @MutinE
Aaron P
@MutinE
Apr 23 2017 03:45
Whats the mini max algorithm? @jdtdesigns
JD Tadlock
@jdtdesigns
Apr 23 2017 03:47
It's algorithm that calculates the most effective move based on every single move that can be played on the board.
It creates a virtual board and plays the game out before calculating the highest percentage move.
Aaron P
@MutinE
Apr 23 2017 03:51
@jdtdesigns You can do that with plain old JS?
JD Tadlock
@jdtdesigns
Apr 23 2017 03:51
@MutinE of course :P
Js is used to create complex games these days
Aaron P
@MutinE
Apr 23 2017 03:55
Awesome thanks! @khaduch
CamperBot
@camperbot
Apr 23 2017 03:55
mutine sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: mutine already gave khaduch points
Aaron P
@MutinE
Apr 23 2017 03:58
@khaduch Wait, its counting down from 100%. I will need it to start at 0% and go up, how can I do that?
Ken Haduch
@khaduch
Apr 23 2017 04:02
@MutinE - making a slight tweak to the code - will repost shortly... All you have to do is flip numbers around... let me make that change.
Aaron P
@MutinE
Apr 23 2017 04:04
@khaduch Thanks a lot btw for helping me, I'm not the greatest at math. In fact, you could even say I despise math.
CamperBot
@camperbot
Apr 23 2017 04:04
mutine sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: mutine already gave khaduch points
Ken Haduch
@khaduch
Apr 23 2017 04:05
@MutinE - here's that snippet of code with the modification to display the elapsed time percentage.
    var totalSecs = displayMins * 60;
    //function to run every second
    var timeInterval = setInterval(function() {
      //miliseconds since Jan 1 (current time)
      var now = new Date().getTime();
      //difference in miliseconds (5 mins...diffMins = 300,000)
      var differenceMS = nowPlusX.getTime() - now;
      var differenceSecs = differenceMS / 1000;
      var remainingSecs = totalSecs - differenceSecs;
      //remaining seconds / total seconds times 100
      console.log(`difference seconds = ${differenceSecs}`);
      console.log(`Elapsed time pct = ${(remainingSecs / totalSecs) * 100}%`);
      //diff of mins
      var minutes = Math.floor((differenceMS % (1000 * 60 * 60)) / (1000 * 60));
of course all of that could be simplified somewhat, but at least you can study that and get the idea, and tweak it... I'm going to sign off for now, so good luck with that...
Aaron P
@MutinE
Apr 23 2017 04:07
@khaduch Thank you!
CamperBot
@camperbot
Apr 23 2017 04:07
mutine sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2776 | @khaduch |http://www.freecodecamp.com/khaduch
JD Tadlock
@jdtdesigns
Apr 23 2017 04:14
@MutinE Heres a two part stream of me adding a trivia game to my chatbot. JS can do cool stuff :) https://youtu.be/GRuhtODBFd8
I also have some fun and get tips from 15 year devs
You never stop learning
Aaron P
@MutinE
Apr 23 2017 04:17
@jdtdesigns I will make sure to check that out!
Aaron P
@MutinE
Apr 23 2017 04:22
I finally finished my Pomodoro Clock! Thoughts?https://codepen.io/apeck14/pen/eWZVjO?editors=1011
If you're going to check it out, set the timer to 1 minute so you're not watching it for long periods of time
max#237
@maximilientoumi
Apr 23 2017 04:27
please help i need it to be horizontal https://codepen.io/max_237/pen/PmzQWp
Gulsvi
@gulsvi
Apr 23 2017 04:33
image.png
@maximilientoumi Your codepen CSS settings should look like this
image.png
Your JavaScript settings should look like this ^^
max#237
@maximilientoumi
Apr 23 2017 04:54
@SkyCoder01 good
thanks
Gulsvi
@gulsvi
Apr 23 2017 04:57
@maximilientoumi Be careful you don't accidentally get instructions from the Bootstrap 4 Documentation :) (https://v4-alpha.getbootstrap.com)
This is the place to learn Bootstrap 3: https://getbootstrap.com/css/
max#237
@maximilientoumi
Apr 23 2017 05:00
ok
dude
lixchen
@lixchen
Apr 23 2017 05:03
function recursion(node) {
        if (node.children[0]) {
            recursion(node.children[0]);
        }
        console.log(node.className);
        if (node.children[1]) {
            recursion(node.children[1]);
        }
    }
    recursion(box);
hello I want know, how can i print the className once a second
Jean-Paul Sauve
@jp-sauve
Apr 23 2017 05:04
I'm just going overboard now, but I've created my quote machine using an api that returns json, and I'd like to use the author field in the returned json object as a search parameter in a custom google api search that I think I can set to return json of a single image result. Can I use the json's field reference (returnValue[0].title) as a variable in a jQuery $.ajax call for the url key? eg.
$.ajax({type:'GET',dataType:'JSON',url:'https://www.googleapis.com/customsearch/v1?q='+(returnValue[0].title)+'&num=1'});
Saboor Malik
@MathematicsCoding
Apr 23 2017 05:11
@sevensixtwo762 :wave:
Jean-Paul Sauve
@jp-sauve
Apr 23 2017 05:12
hello again @MathematicsCoding
Saboor Malik
@MathematicsCoding
Apr 23 2017 05:12
@sevensixtwo762 I still need your help with roman numerals convertor
I waited for you like few days
Kidding
Jean-Paul Sauve
@jp-sauve
Apr 23 2017 05:13
lol. You'll have to wait until I get there. I'm on quote machine right now, and having fun
Saboor Malik
@MathematicsCoding
Apr 23 2017 05:13
ah
Jean-Paul Sauve
@jp-sauve
Apr 23 2017 05:14
working on my $.ajax actually.
Saboor Malik
@MathematicsCoding
Apr 23 2017 05:15
about @sevensixtwo762
CamperBot
@camperbot
Apr 23 2017 05:15
:cookie: 285 | @sevensixtwo762 |http://www.freecodecamp.com/sevensixtwo762
Gulsvi
@gulsvi
Apr 23 2017 05:15

@sevensixtwo762 yes, you can use returnValue[0].title as a parameter to your ajax URL. You shouldn't need the parentheses though. Maybe an easier way is to declare

var url = 'https://www.googleapis.com/customsearch/v1?q='+(returnValue[0].title)+'&num=1';

console.log it and browse to it manually to make sure it is a valid page, and then just the variable url in your ajax call:

$.ajax({type:'GET',dataType:'JSON',url:'https://www.googleapis.com/customsearch/v1?q='+url+'&num=1'});
about @MathematicsCoding
CamperBot
@camperbot
Apr 23 2017 05:15
:cookie: 339 | @mathematicscoding |http://www.freecodecamp.com/mathematicscoding
Saboor Malik
@MathematicsCoding
Apr 23 2017 05:16
??
I know... I ate a lot of cookies
Gulsvi
@gulsvi
Apr 23 2017 05:16
I was checking out your code again
Saboor Malik
@MathematicsCoding
Apr 23 2017 05:17
Which code?
Gulsvi
@gulsvi
Apr 23 2017 05:17
The answer you got for your Roman Numeral Converter
Saboor Malik
@MathematicsCoding
Apr 23 2017 05:17
Ah
Didnt I show you that before lol
The answer you got for your Roman Numeral Converter
You sounds like you thought I copied that solution from somewhere...
Gulsvi
@gulsvi
Apr 23 2017 05:20
No, I couldn't remember it to be honest
There are only a few ways to solve it I think
Saboor Malik
@MathematicsCoding
Apr 23 2017 05:21
Our code are actually similiar
But your arrays is spaced
An array each line
Gulsvi
@gulsvi
Apr 23 2017 05:21
You were asking for help above up there and I thought you had already submitted anyway
Saboor Malik
@MathematicsCoding
Apr 23 2017 05:21
oh That was a joke lol
Gulsvi
@gulsvi
Apr 23 2017 05:21
oh, okay lol
Saboor Malik
@MathematicsCoding
Apr 23 2017 05:21
He is the one who gave me these algorithm
Well link then I found it
I, IV, V, IX, X so on...
@SkyCoder01 free to help?
Saboor Malik
@MathematicsCoding
Apr 23 2017 05:28
Never mind figured out the problem
Hey what is invalid data number?
like 404..
Todd Abraham
@toddabraham
Apr 23 2017 05:29
As we work through the various exercises and projects, what’s the general thought on referring to YouTube videos to view someone solving a problem? I
Saboor Malik
@MathematicsCoding
Apr 23 2017 05:30
Well you wont probably learn anything..
I wouldnt recommand it but you could check out better code after you solve it by yourself
Aaron P
@MutinE
Apr 23 2017 06:30
@toddabraham Learning from outside resources as well as FCC is encouraged.
As long as you understand what's going on and aren't just copying someone else's code.
Aaron P
@MutinE
Apr 23 2017 06:46
@jdtdesigns you there?
Jean-Paul Sauve
@jp-sauve
Apr 23 2017 07:11
but don't give up after an hour. The time spent struggling will lead to a better understanding.
Md. Foridur Kayes Shawon
@kayes-shawon
Apr 23 2017 07:40
can anyone share his pen problem 119
Buhaianu Remus
@Remus432
Apr 23 2017 09:14
Hey guys I can't figure this code out

function nextInLine(arr, item) {
  // Your code here

  arr.push(item);
  arr.shift();
  return arr.push(item);  // Change this line
}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
Write a function nextInLine which takes an array (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of array. The nextInLine function should then return the element that was removed.
h1tag
@h1tag
Apr 23 2017 09:23

@Remus432

The nextInLine function should then return the element that was removed.

And you're returning the the item that was added, not the item that was removed + you're pushing the item twice

Anna
@AnnaVih
Apr 23 2017 09:23
hi guys!I got problem with my portfolio project.I just started,and when i put code from bootstrap for my navbar when i resize window the link do not show
h1tag
@h1tag
Apr 23 2017 09:24
@AnnaVih can you paste the link to your pen here
Buhaianu Remus
@Remus432
Apr 23 2017 09:25
@fortMaximus so I should use return arr.shift(); ?
h1tag
@h1tag
Apr 23 2017 09:25
@Remus432 what do you think?
h1tag
@h1tag
Apr 23 2017 09:26
@AnnaVih Bootstrap navbar needs jQuery and Bootstrap js
Anna
@AnnaVih
Apr 23 2017 09:27
ow ow
@fortMaximus i add now in settings but probably something wrong
h1tag
@h1tag
Apr 23 2017 09:31
where's jQuery?
you also have to add it before the Bootstrap js file
Anna
@AnnaVih
Apr 23 2017 09:32
done!
@fortMaximus sorry bout that
@fortMaximus thanks!!
CamperBot
@camperbot
Apr 23 2017 09:33
annavih sends brownie points to @fortmaximus :sparkles: :thumbsup: :sparkles:
:cookie: 736 | @fortmaximus |http://www.freecodecamp.com/fortmaximus
Buhaianu Remus
@Remus432
Apr 23 2017 09:39
well shift() removes the first element is like the pop() but the only difference is that pop() removes the last emenet
it should return the removed item
element
h1tag
@h1tag
Apr 23 2017 09:40
and what the challenge is asking u to return?
Federico Dente
@fez994
Apr 23 2017 09:40
Does anyone know where i can find a free mp3 bell sound for the pomodoro clock? I've been googling for the past 15 minutes but all i could find was paid stuff
Buhaianu Remus
@Remus432
Apr 23 2017 09:41
i figured out that i was using arr.shift() and then return arr.shift();
h1tag
@h1tag
Apr 23 2017 09:42
@Remus432 did u solve it?
Buhaianu Remus
@Remus432
Apr 23 2017 09:42
I didn't have to use arr.shift() alone
Yes the solution was arr.push(item) so it adds the element to the end of the array and then return arr.shift(); so it returns the removed element
h1tag
@h1tag
Apr 23 2017 09:44

i figured out that i was using arr.shift() and then return arr.shift();

yes, if you do this, it'll remove an element from the start of the array twice

Darth Skywalker
@adityaparab
Apr 23 2017 09:46
just do return arr.shift()
Federico Dente
@fez994
Apr 23 2017 10:08
@fortMaximus Thanks man
CamperBot
@camperbot
Apr 23 2017 10:08
fez994 sends brownie points to @fortmaximus :sparkles: :thumbsup: :sparkles:
:cookie: 737 | @fortmaximus |http://www.freecodecamp.com/fortmaximus
Lickitte
@Lickitte
Apr 23 2017 10:18
Hi, I don't know where to even start with the portfolio page
Do you start with a template or anything?
Pieter Stokkink
@forkerino
Apr 23 2017 10:20
@Lickitte I started with installing bootstrap and creating different sections on my page.
heroiczero
@heroiczero
Apr 23 2017 10:21
@Lickitte I started by planning how i want to design my page by getting a rough sketch by hand
h1tag
@h1tag
Apr 23 2017 10:22
:+1:
Lickitte
@Lickitte
Apr 23 2017 10:23
Ok thanks, ill figure something out
Spyrantis Theodoros
@thodorisanta
Apr 23 2017 10:39

why is my page loading and never actually opens :/

http://codepen.io/oshikurou/pen/RVRqLM?editors=1011

Sorin Ruse
@sorinr
Apr 23 2017 10:42
@thodorisanta check your js syntax. think there is missing some } closing brackets and some missing semicolons
simplist88
@simplist88
Apr 23 2017 10:51
Hi guys, may I know how to type code here in pretty way?
heroiczero
@heroiczero
Apr 23 2017 10:51
'''
CamperBot
@camperbot
Apr 23 2017 10:51
:bulb: to format code use backticks! ``` more info
heroiczero
@heroiczero
Apr 23 2017 10:51
@simplist88 :point_up: April 23, 2017 6:51 AM
simplist88
@simplist88
Apr 23 2017 10:52
Thanks everyone,
actually I'm working on random quote machine, using Quotes on Design API.
My AJAX attempt is failing to append the response somehow..
<script type="text/javascript">
      $('.quote-button').on('click', function(e){
        console.log(e);
        e.preventDefault();
        $.ajax({
          dataType: "jsonp",
          crossDomain: true,
          url: "http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&_jsonp=",
          success: function(data) {
            var post = data;
            console.log(post);
            $('.quete-box').append(post.title + post.content);
          },
          cache: false
        });
      })
      /*
      const ajaxButton = document.querySelector('.quote-button');
      console.log(ajaxButton);

      function retrieveQuote (e) {
        e.preventDefault();
        console.log(e);
        httpRequest = new XMLHttpRequest();
        console.log(httpRequest);
        if (!httpRequest) {
          alert('Cannot create request');
          return false;
        }
        httpRequest.onreadystatechange = alertStatus;
        httpRequest.open('GET', 'http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&_jsonp=mycallback');
        httpRequest.send();
      }

      function alertStatus () {
        if (httpRequest.readyState == 4) {
          if (httpRequest.status == 200) {
            // parse response
            console.log(httpRequest.response);
            console.log(httpRequest.responseText);
          } else {
            // error handling
            alert('There was a technical issue with your request, please try later');
            console.log('error: ' + httpRequest.status + ' ' + httpRequest.statusText);
          }
        }
      }

      ajaxButton.addEventListener('click', retrieveQuote);
      */
    </script>
Sorry please ignore / / part of codes.
below code with plain JS.
will be discarded.
<body>
    <div class="quote-container">
      <div class="quote-box">
        <blockquote cite="http://wwww.abcd.co.kr">
        </blockquote>
        <button class="twitter-button"><i class="fa fa-twitter fa-2x" aria-hidden="true"></i></button>
        <button class="quote-button">New quote</button>
      </div>
    </div>
  </body>
  <script type="text/javascript">
    $('.quote-button').on('click', function(e){
      console.log(e);
      e.preventDefault();
      $.ajax({
        dataType: "jsonp",
        crossDomain: true,
        url: "http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&_jsonp=",
        success: function(data) {
          var post = data;
          console.log(post);
          $('.quete-box').append(post.title + post.content);
        },
        cache: false
      });
    })
  </script>
this is complete code
rohitdesigner
@rohitdesigner
Apr 23 2017 10:56
anybody here?
Sorin Ruse
@sorinr
Apr 23 2017 10:57
@simplist88 does your console.log(post); show the returned object in the console?
simplist88
@simplist88
Apr 23 2017 10:58
Not really.
rohitdesigner
@rohitdesigner
Apr 23 2017 10:59
<!DOCTYPE html>
<html lang="en">

<head>
    <link rel="stylesheet" type="text/css" href="semantic/dist/semantic.min.css">
    <script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
    <script src="semantic/dist/semantic.min.js"></script>

    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="css/style.css" rel="stylesheet">
</head>

<body>
    <div class='nav'>
        <ul>

        </ul>
    </div>
    <script src="js/script.js">
    </script>
</body>

</html>
simplist88
@simplist88
Apr 23 2017 10:59
it doesn't appeared in console, but in Source in Dev
rohitdesigner
@rohitdesigner
Apr 23 2017 10:59
@sorinr why scroll is coming
Sorin Ruse
@sorinr
Apr 23 2017 11:12
@simplist88 here your working example
@simplist88 look into dev tools console for the returned object
simplist88
@simplist88
Apr 23 2017 11:16
I'm seeing returned object in Dev tool now.
Why my code isn't working?
I mean the previous code, seeing you were using diffrent request URL
Sorin Ruse
@sorinr
Apr 23 2017 11:23
@simplist88 probably was the url. i just went on their docs page any copied the example url
@simplist88 think you have used the url for wp-json wordpress
Pieter Stokkink
@forkerino
Apr 23 2017 12:14
@fortMaximus ty
CamperBot
@camperbot
Apr 23 2017 12:14
forkerino sends brownie points to @fortmaximus :sparkles: :thumbsup: :sparkles:
:cookie: 738 | @fortmaximus |http://www.freecodecamp.com/fortmaximus
h1tag
@h1tag
Apr 23 2017 12:15
@forkerino welcome :+1:
Keon Samuel
@keonsam
Apr 23 2017 12:17
what website you guys use to get complementary colors?
Pieter Stokkink
@forkerino
Apr 23 2017 12:19
@keonsam color.adobe.com
Spyrantis Theodoros
@thodorisanta
Apr 23 2017 12:20

so in JS in line 104 i need to add a curly brackets, but when i do i get a whole bunch of errors. can anyone help?

http://codepen.io/oshikurou/pen/RVRqLM?editors=1011

Yashasvi
@TechMky
Apr 23 2017 12:41
How do you load font awesome in codepen?
does anyone have any idea?
I prefer coding locally and then uploading the files to codepen, but it gives birth to a lot of bugs
Roxroy
@roxroy
Apr 23 2017 12:43
@TechMky , you can add it in the CSS section of the settings tab. That is what I do
Yashasvi
@TechMky
Apr 23 2017 12:47
@roxroy then after that should I remove the link tag in my html section?
Roxroy
@roxroy
Apr 23 2017 12:50
@TechMky , Yes, you would not need it there any more. Codepen would merge the links in the settings with the HTML content to render the final page.
Vincent Del Vecchio
@DVecc
Apr 23 2017 12:53
@thodorisanta
Line 104 missing a closing }
line 78 should be === to compare to
line 79 should be !==
Is this supposed to be inside or outside of the onclick started on line 75?
```
 var cellNames = ["#cell-0", "#cell-1", "#cell-2", "#cell-3", "#cell-4", "#cell-5", "#cell-6", "#cell-7", "#cell-8"];
      var winCombos = [
        [0, 1, 2],
        [3, 4, 5],
        [6, 7, 8],
        [0, 3, 6],
        [1, 4, 7],
        [2, 5, 8],
        [0, 4, 8],
        [2, 4, 6]
      ];
      var cellValues = [];
      var Xvalues = [];
      var Ovalues = [];
Yashasvi
@TechMky
Apr 23 2017 12:56
@roxroy Allright, thanks
CamperBot
@camperbot
Apr 23 2017 12:56
techmky sends brownie points to @roxroy :sparkles: :thumbsup: :sparkles:
:cookie: 719 | @roxroy |http://www.freecodecamp.com/roxroy
JD Tadlock
@jdtdesigns
Apr 23 2017 13:45
@MutinE Here
Keon Samuel
@keonsam
Apr 23 2017 13:49
anyone tried beta yet?
why is this failing the tests?
Tom
@moT01
Apr 23 2017 13:54
@keonsam im not sure how accurate that thing is, ...but it looks like its looking for things with specific id names
click the tribute on the drop down box, and hit the tests button, and a window comes up that shows some things you could maybe do to pass
alpox
@alpox
Apr 23 2017 13:58
@keonsam 1. My tribute page should have an element with corresponding id="main", which contains all other elements
NikhilKhatana
@NikhilKhatana
Apr 23 2017 14:03
I am on the tribute page project and I am noticing that I do not remember how to do many things from the mini-challenges before. I don't believe I spent the number of hours it listed. Should I go back and redo everything?
Or should I continue to go back and read the lessons when I can't remember how to do something? When I do this, I feel like I am not learning and I haven't learned anything.
Roxroy
@roxroy
Apr 23 2017 14:05
@NikhilKhatana , go back and review them, but you don't need to redo them. Also, check out some other sources to re-enforce the various concepts for each topic.
Pieter Stokkink
@forkerino
Apr 23 2017 14:05
@NikhilKhatana instead of going over everything again, be selective. See what you want to do and don't know how to, and only then look back to the exercises or go look in the documentation at mdn or getbootstrap.com or wherever you find something.
Tom
@moT01
Apr 23 2017 14:06
try to find a way that helps you figure out how to do things, @NikhilKhatana maybe another site or youtube videos or something, ...the further along you get the less the challenges will help, they want you to be able to figure things out without the help of the challenges
NikhilKhatana
@NikhilKhatana
Apr 23 2017 14:08
@roxroy @moT01 @forkerino Thank you I think you guys are correct in that I need more practice to reinforce the concepts. Do you have any suggestions on websites or other resources I can use to practice before moving on so that I can really understand and remember everything?
CamperBot
@camperbot
Apr 23 2017 14:08
:cookie: 631 | @mot01 |http://www.freecodecamp.com/mot01
nikhilkhatana sends brownie points to @roxroy and @mot01 and @forkerino :sparkles: :thumbsup: :sparkles:
:cookie: 726 | @roxroy |http://www.freecodecamp.com/roxroy
:star2: 1883 | @forkerino |http://www.freecodecamp.com/forkerino
Tom
@moT01
Apr 23 2017 14:12
@NikhilKhatana i like youtube for general how to do things, but for specifics i like MDN for html, and js, and css tricks for css
Pieter Stokkink
@forkerino
Apr 23 2017 14:14
@NikhilKhatana One of the biggest traps in learning how to code is to not write until you understand it (at least, it is a big trap for me). Build stuff. Experiment. If you run into bugs, or things not working the way you expect, look at the docs or do a tutorial or watch a video. This will teach you a lot more and a lot faster than going over lessons again and again. Fail fast, learn fast.
NikhilKhatana
@NikhilKhatana
Apr 23 2017 14:22
Great @forkerino @moT01 . One last question, is it bad to learn by looking at other people's code?
Tom
@moT01
Apr 23 2017 14:23
i dont think so
Pieter Stokkink
@forkerino
Apr 23 2017 14:23
@NikhilKhatana no, it can be very helpful. Don't copy it without understanding it, though, that is just trouble.
Tom
@moT01
Apr 23 2017 14:23
i wouldnt just copy and paste and forgot it, ...but check it out see how they do things
Pieter Stokkink
@forkerino
Apr 23 2017 14:25
best would be to write it out yourself, even if you copy it directly. Pause if you don't get it.
Keon Samuel
@keonsam
Apr 23 2017 14:30
what day does kingdom manga get release on?
Vincent Del Vecchio
@DVecc
Apr 23 2017 14:48
Learning from others code is definitely acceptable imo
also @NikhilKhatana I find the best thing to do when having trouble remembering how to do something is to look at bootstraps documentation for what you're trying to do
Paradox5
@Paradox5
Apr 23 2017 15:01
For everyone in my timezone or who ever else has a timezone similar to mine good morning world
Jorge
@OrangeKulture
Apr 23 2017 15:14
hey guys, happy Sunday
Yashasvi
@TechMky
Apr 23 2017 15:17
Hey everyone, I just finished my tribute page and would really appreciate your feedback.
there is one bug which is bothering me
just try resizing the window and notice the sidebar.
Jorge
@OrangeKulture
Apr 23 2017 15:19
@TechMky looks really good!
what about the side bar?
Yashasvi
@TechMky
Apr 23 2017 15:21
@OrangeKulture just resize the window to a really small size and you'll notice that the "Follow me on" part is not visible
also notice the behaviour of blue border around the side bar
Jorge
@OrangeKulture
Apr 23 2017 15:22
you need media queries dude
Yashasvi
@TechMky
Apr 23 2017 15:24
I know nothing about that (yet), so I'll probably move on and rectify this later
Jorge
@OrangeKulture
Apr 23 2017 15:26
yeah it's basically break points in width so that elements behave differently.. I wouldnt worry too much about it, the page looks really good and that only shows when it's incredibly small ..
@TechMky great job!
Yashasvi
@TechMky
Apr 23 2017 15:29
@OrangeKulture Appreciate that.
Soumyojyoti Majumdar
@SoumyoNawab8
Apr 23 2017 15:56
Roxroy
@roxroy
Apr 23 2017 16:02
@Soumyoahona200 , works great. Got my correct location and temperature.
Jorge
@OrangeKulture
Apr 23 2017 16:19
@safiyaburawais94 also looking good! nice job
Roxroy
@roxroy
Apr 23 2017 16:20
@safiyaburawais94 , nice clean layout. Good use of bootstrap classes. good job.
Saboor Malik
@MathematicsCoding
Apr 23 2017 16:34
Hey guys
I need help
I have background image problem...
I cant get that logo center
Even cover doesnt work
Jorge
@OrangeKulture
Apr 23 2017 16:38
@MathematicsCoding how about
background-repeat: no-repeat;
background-position: 50% 20%;
Saboor Malik
@MathematicsCoding
Apr 23 2017 16:39
xD
Good but not just center
Jorge
@OrangeKulture
Apr 23 2017 16:40
you can play around with the %'s
Saboor Malik
@MathematicsCoding
Apr 23 2017 16:40
30 instead of 20
Yea
@OrangeKulture thanks
CamperBot
@camperbot
Apr 23 2017 16:41
mathematicscoding sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 327 | @orangekulture |http://www.freecodecamp.com/orangekulture
Saboor Malik
@MathematicsCoding
Apr 23 2017 16:41
So whats % and %?
Jorge
@OrangeKulture
Apr 23 2017 16:41
sure thing
width and height
Saboor Malik
@MathematicsCoding
Apr 23 2017 16:41
First % left and right and'
ah
But logo moves when I hit search button
You know what... This is annoying iM going to find another image..
Brb
Czpl
@Czpl
Apr 23 2017 16:43
heloo
Im creating my own reusable function to parallax images, anyone want's to test? :D https://codepen.io/czpl/full/vmKvWM/
Jorge
@OrangeKulture
Apr 23 2017 16:44
@MathematicsCoding yeah i cant see it in full page, since it's your pen .. so im not really sure about the numbers, i just popped in what i thought might be good
@Czpl looking good ! parallax is always fun
Roxroy
@roxroy
Apr 23 2017 16:45
@Czpl , parallaxThis works well. Nice effect.
Jorge
@OrangeKulture
Apr 23 2017 16:45
@Czpl last one might be a little off? im not sure if that's the effect you are looking for
Czpl
@Czpl
Apr 23 2017 16:46
last one has different speed
i wanted that function to be as reusable as possible. If you check the code you can pass an array of id's and speed
Jorge
@OrangeKulture
Apr 23 2017 16:47
no i mean you can see the end of the pic before you scroll to the bottom
Czpl
@Czpl
Apr 23 2017 16:50
looks like speed value cant be bigger than 1 :D
but thanks for pointing that out @OrangeKulture
CamperBot
@camperbot
Apr 23 2017 16:50
czpl sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 328 | @orangekulture |http://www.freecodecamp.com/orangekulture
Jorge
@OrangeKulture
Apr 23 2017 16:50
sure thing! @Czpl other than that, looking awesome
were u doing a challenge from here? or just playing around with parallax ?
Czpl
@Czpl
Apr 23 2017 16:51
just playing around
Jorge
@OrangeKulture
Apr 23 2017 16:52
oh really, that's cool
im probably gonna fork it :D and play around too .. nice 1
Adam Jacks
@AdamHJ123
Apr 23 2017 16:55
I start my first frontend dev job tomorrow!
Czpl
@Czpl
Apr 23 2017 16:56
good luck :D
Jorge
@OrangeKulture
Apr 23 2017 16:56
@AdamHJ123 really? that's awesome .. congrats
did you first learn about FrontEnd at FCC ?
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:03
@OrangeKulture He got front end cert from here
Check out his link and his profile
@AdamHJ123 Nice project but I think there is a mistake
Jorge
@OrangeKulture
Apr 23 2017 17:04
did he? that's good .. i wanna start doing some back end too, but now i don't know what backend IDE to use
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:04
Try clicking your wikipedia viewer it took me to zombie game
Nurbek
@NurbekGithub
Apr 23 2017 17:07
Hello fellow coders! I am doing Twitchtv json API challenge and got stuck. the JSON I get from URL: 'https://wind-bow.gomix.me/twitch-api/streams/freecodecamp?callback=?' doesn't seem to be right one; Has anyone aleady done it? Please, help
What do you think?
@NurbekGithub change gomix to glitch
They are old
about @MathematicsCoding
CamperBot
@camperbot
Apr 23 2017 17:08
:cookie: 341 | @mathematicscoding |http://www.freecodecamp.com/mathematicscoding
Nurbek
@NurbekGithub
Apr 23 2017 17:10
@MathematicsCoding the same here
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:10
Let me see your pen
@MathematicsCoding I am working with console to check JSON
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:12
Oh I see
What do you want to do?
Add users list to page or?
Nurbek
@NurbekGithub
Apr 23 2017 17:13
I want to add channels list with references.
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:13
Well do you know how to select things from API?
Nurbek
@NurbekGithub
Apr 23 2017 17:13
I can do it it, but references won't work. I see it from console
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:13
Like if you want to get logo from users API you do this data.logo
Nurbek
@NurbekGithub
Apr 23 2017 17:14
yes
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:14
Yeah you havent done that?
Your console works
You just have to select it
Nurbek
@NurbekGithub
Apr 23 2017 17:15
which one; I tried to follow https://api.twitch.tv/kraken/channels/freecodecamp, but it's empty
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:15
Remember this?
Try users API instead
Nurbek
@NurbekGithub
Apr 23 2017 17:17
I think I have some problem with explaining my issue, because of my language level. Thank you anyway. I will try to work it out
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:17
Alright Good luck
Anthony Pierson
@Donald-Tho
Apr 23 2017 17:19
If I want to edit the text of a tweet, which is the property data-text , how do I do that with JQuery? I tried using $("#Tweet").data("data-text","insert text here"); and it didn't work.
Jordan
@jmoore197
Apr 23 2017 17:20
Hello everyone! I am currently building a Tribute page and need help on how I can align jumbotron class and the text beneath it to make the page look better. I know it is just a HTML project but I really want it to look better. Here's the link: https://codepen.io/jmoore197/full/xdVPMW/
Also, some feedback on my code will be helpful as well!
Anthony Pierson
@Donald-Tho
Apr 23 2017 17:21
try containing it in a <center></center>. It usually works best without a row div in my experience.
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:22
@jmoore197 nice project and I think you should change background color to black and text to white
That would be cool after all its your personal style
Soumyojyoti Majumdar
@SoumyoNawab8
Apr 23 2017 17:24
@roxroy thanks
CamperBot
@camperbot
Apr 23 2017 17:24
soumyoahona200 sends brownie points to @roxroy :sparkles: :thumbsup: :sparkles:
:cookie: 738 | @roxroy |http://www.freecodecamp.com/roxroy
Gulsvi
@gulsvi
Apr 23 2017 17:25
@Donald-Tho To update the twitter widget's data-text, you actually have to use the twitter widget's createShareButton function: https://dev.twitter.com/web/tweet-button/javascript-create
Normally, though, it would be either $("#Tweet").data("text","insert text here"); or $("#Tweet").attr("data-text","insert text here"); depending on how the HTML was first created. I have more success with .attr() compared to .data() (still trying to fully figure that one out) :)
Jordan
@jmoore197
Apr 23 2017 17:26
@MathematicsCoding Thank you for the feedback!
CamperBot
@camperbot
Apr 23 2017 17:26
jmoore197 sends brownie points to @mathematicscoding :sparkles: :thumbsup: :sparkles:
:cookie: 342 | @mathematicscoding |http://www.freecodecamp.com/mathematicscoding
Roxroy
@roxroy
Apr 23 2017 17:27
@jmoore197 , it would be good to center the 'Here's some of Neil deGrasse Tyson's work:' section on the page
Gulsvi
@gulsvi
Apr 23 2017 17:27
@jmoore197 Codepen adds bootstrap 4 in the settings by default, but we learn bootstrap 3 in free code camp. So, some of your classes aren't working as expected. Go into your codepen settings, click "CSS" and replace the link to bootstrap 4 with: https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css
That will center everything the way you're intending with your HTML

Also, instead of this:

<center><img src ="https://img.buzzfeed.com/buzzfeed-static/static/2014-03/campaign_images/webdr08/11/17/25-reasons-neil-degrasse-tyson-is-a-universal-tre-1-1530-1394573554-23_big.jpg" >
  </img></center>

Do:

<img class="img-responsive center-block" src ="http://assets1.ignimgs.com/2015/01/08/neil-degrasse-tyson-1280jpg-544a6b_1280w.jpg" >

The <center> tag is old HTML4 code and the <img> tag doesn't need to be closed. And, you need a bigger image to take up the thumbnail whitespace

Jordan
@jmoore197
Apr 23 2017 17:32
@SkyCoder01 Beautiful! Thank you so much, here's the updated version of tribute page now: https://codepen.io/jmoore197/full/xdVPMW/
CamperBot
@camperbot
Apr 23 2017 17:32
jmoore197 sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:star2: 1150 | @skycoder01 |http://www.freecodecamp.com/skycoder01
Vincent Del Vecchio
@DVecc
Apr 23 2017 17:33
I was trying to fix your page up before getting back to you
however I had a problem with the thumbnails frame being too large
how did you end up fixing that?
Jordan
@jmoore197
Apr 23 2017 17:33
@roxroy just centered it, it looks a lot better thank you
CamperBot
@camperbot
Apr 23 2017 17:33
jmoore197 sends brownie points to @roxroy :sparkles: :thumbsup: :sparkles:
:cookie: 740 | @roxroy |http://www.freecodecamp.com/roxroy
Vincent Del Vecchio
@DVecc
Apr 23 2017 17:34
also the caption div should be inside the thumbnail div @jmoore197
Gulsvi
@gulsvi
Apr 23 2017 17:35
@DVecc Thumbnail frame was too large because the image was too small. Using a bigger image made it fit better inside the thumbnail.
If you change container to container-fluid you'll see the same problem again because the newer image is around 1000px wide at maximum size
Vincent Del Vecchio
@DVecc
Apr 23 2017 17:36
ah, I guess he used a larger img as the src
ah
that's why
I had changed it to container-fluid when looking on my end
Gulsvi
@gulsvi
Apr 23 2017 17:36
Lots of variables to keep track of lol
Gets confusing quickly
Good catch on the caption text, by the way, I didn't see that :)
Jordan
@jmoore197
Apr 23 2017 17:39
How does it look now? I made all the adjustments you guys suggested https://codepen.io/jmoore197/full/xdVPMW/
aceroAD
@aceroAD
Apr 23 2017 17:53
hi everyone, i have a problem with te img-responsive although i put it as class it doesnt make my img change when i rescale de browser
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:54
@SkyCoder01
Gulsvi
@gulsvi
Apr 23 2017 17:54
@MathematicsCoding
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:54
Can you help me adding channel api using data.url
Gulsvi
@gulsvi
Apr 23 2017 17:54
I can try
Gulsvi
@gulsvi
Apr 23 2017 17:55
@aceroAD Are you using Codepen? If so, make sure you are using Bootstrap 3 instead of the Bootstrap 4 link they give you in the quick-add menu. https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css
@MathematicsCoding What do you mean by data.url?
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:56
Well I want to grab url from channel api
You know like logo, display_name etc..
"url" : channel link
Gulsvi
@gulsvi
Apr 23 2017 17:57
The URL is in: ._links.self
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:57
users api?
Gulsvi
@gulsvi
Apr 23 2017 17:58
In your dataCollection object
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:58
yeah
Thought It was something else..
so dataCollection.self?
Gulsvi
@gulsvi
Apr 23 2017 17:58
image.png
In your debug console, you can navigate to the data you want, right-click it, and then select "copy path" and it will give you the code you need to access the object property
It gives me ._links.self
so it would be dataCollect._links.self
Saboor Malik
@MathematicsCoding
Apr 23 2017 17:59
dataCollection._links.self?
ah
How did you do it?
browser console?
Gulsvi
@gulsvi
Apr 23 2017 17:59
yeah, browser console
There's a triangle next to the word "object"
fabrice
@Delondre
Apr 23 2017 18:00
hello
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:00
I see
Gulsvi
@gulsvi
Apr 23 2017 18:00
that's your dataCollection object, drill down into that, find the data you want, right-click, and copy the path
Hello @Delondre
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:01
$('.channel ul').append('<li><img alt="" class="profile-pic" src="' + logo + '"> ' + '- ' + name + '</li>'+'bio - '+bio+'<br>'+'channel - '+'<a href='+dataCollection._links.self+'</a>');
'<a href='+dataCollection._links.self+'</a>'
OH missing >
fabrice
@Delondre
Apr 23 2017 18:02
i'm on the stage of building a tribute page
and i don't understand what to do
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:03
'<a href='+dataCollection._links.self+'></a>'
Gulsvi
@gulsvi
Apr 23 2017 18:04
@MathematicsCoding Sorry, still drinking my coffee. I didn't understand what you were trying to do :/
aceroAD
@aceroAD
Apr 23 2017 18:04
@SkyCoder01 thanks for it, theyve taken that class in bootstrap 4?
CamperBot
@camperbot
Apr 23 2017 18:04
aceroad sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:star2: 1151 | @skycoder01 |http://www.freecodecamp.com/skycoder01
Gulsvi
@gulsvi
Apr 23 2017 18:04
@MathematicsCoding The URL for a users's channel is: https://www.twitch.tv/ + username right?
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:04
yes
Gulsvi
@gulsvi
Apr 23 2017 18:04
So,just build it that way
You have their display name already
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:04
right...
Gulsvi
@gulsvi
Apr 23 2017 18:05
@aceroAD Yeah, they removed img-responsive from Bootstrap 4. Lots of class names changed unfortunately...
aceroAD
@aceroAD
Apr 23 2017 18:05
mmm they should change that in freecodecamp
Gulsvi
@gulsvi
Apr 23 2017 18:06
@Delondre You just need to build a page similar to the example. Maybe if you search for "Tribute Page" on codepen, it will help give you some ideas of what you can build: http://codepen.io/search/pens?q=tribute+page&limit=all&type=type-pens
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:06
 $('.channel ul').append('<li><img alt="" class="profile-pic" src="' + logo + '"> ' + '- ' + name + '</li>'+'bio - '+bio+'<br>'+'channel - '+'<a href='+'https://www.twitch.tv/' + dataCollection+'></a>');
fabrice
@Delondre
Apr 23 2017 18:06
ah ok tks
Gulsvi
@gulsvi
Apr 23 2017 18:07
@MathematicsCoding no
fabrice
@Delondre
Apr 23 2017 18:07
@SkyCoder01 ok tks
i did'nt even great u
Gulsvi
@gulsvi
Apr 23 2017 18:08
No problem, happy to help @Delondre
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:08
'<a href='+channel+'></a>'
Look at channel variable
well?
Gulsvi
@gulsvi
Apr 23 2017 18:10
@MathematicsCoding The URL to a user's channel is https://www.twitch.tv/ + name
You have name defined already
And a <a> tag needs text in it or there's nothing to click
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:11
What do you mean?
'<a href='+'https://www.twitch.tv/'+name+'></a>'
Gulsvi
@gulsvi
Apr 23 2017 18:11
@MathematicsCoding Right ^^
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:11
So?
And a <a> tag needs text in it or there's nothing to click
What did you mean by that
Gulsvi
@gulsvi
Apr 23 2017 18:11
But there's nothing in between the <a> tags
<a href="https://www.google.com">Google</a>
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:12
ooh
Do I need that?
Gulsvi
@gulsvi
Apr 23 2017 18:12
Let's not go back to basic HTML now :/
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:12
:\
I forgot anchor elements need text in it..
Gulsvi
@gulsvi
Apr 23 2017 18:13
Yep, or else there's nothing to click on
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:13
lemme try add button instead
Button can take you to that link right?
Gulsvi
@gulsvi
Apr 23 2017 18:14
The <a> tag is for navigating to a link
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:14
Oh it have to be nested with a elements
Gulsvi
@gulsvi
Apr 23 2017 18:14
<button> is for submitting data
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:14
Right..
I clicked channel and it went blank
target=_blank?
Gulsvi
@gulsvi
Apr 23 2017 18:14
yeah, for codepen
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:16
it works but I want it to go to link on page instead
Not new tab
Gulsvi
@gulsvi
Apr 23 2017 18:16
Where do you want it to go?
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:17
In codepen
Like click channel then link show up on codepen
Gulsvi
@gulsvi
Apr 23 2017 18:17
How would you write it in HTML?
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:17
well..
Gulsvi
@gulsvi
Apr 23 2017 18:18
You have to use target="_blank" for most links in codepen or they won't work
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:18
<a href="url" target"_blank">
Yeah
I dont want it to go somewhere to different tab
Like this random article for example
Gulsvi
@gulsvi
Apr 23 2017 18:21
@MathematicsCoding That won't work with Twitch unfortunately. You have to open in a new tab
At least in codepen
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:21
Welp...
:\
wtf?
Gulsvi
@gulsvi
Apr 23 2017 18:21
You could maybe use a modal, not sure, but you're going to have to practice modals in another codepen
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:22
I think one user is missing
Brunofin is not there
Gulsvi
@gulsvi
Apr 23 2017 18:22
Yeah, you have an error in your debug console
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:24
Eh I have to delete that var channel
Keon Samuel
@keonsam
Apr 23 2017 18:24
Saboor you need help?
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:24
They are useless
No Im fine @keonsam
Gulsvi
@gulsvi
Apr 23 2017 18:25
Yep, you don't need that
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:25
:\
I tested and I got bad request tho
Gulsvi
@gulsvi
Apr 23 2017 18:25
Glad I can give you an error and you can debug it though :)
Good improvement
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:25
thanks :\
"Thud"
Its all because of this book
Nah Im kidding I didnt read it yet..
:books:
@keonsam
wanna take a look?
twitch tv
@SkyCoder01 I dont understand this..
User Story: I can see whether Free Code Camp is currently streaming on Twitch.tv.
User Story: if a Twitch user is currently streaming, I can see additional details about what they are streaming.
I think users api doesnt have streaming
Gulsvi
@gulsvi
Apr 23 2017 18:28
@MathematicsCoding You have to have Free Code Camp as a user listed and show whether they are online or offline. If they're online, you should be able to show what they are streaming.
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:29
Using streams api?
Shell Brien
@mbrien12
Apr 23 2017 18:29
hi everyone, I'm a bit stuck on the random quote machine and hoping somebody can help! I can't get the tweet to display the quote content, have used $('#twitter-share-button').attr('href', 'https://twitter.com/intent/tweet?text=' + encodeURIComponent('"' + quote + '" ' + author)); console.log(quote, author); but it just displays the title of the page instead and I can't work out why, any ideas that may help?
Keon Samuel
@keonsam
Apr 23 2017 18:29
just get coding.
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:29
Even if it is I dont know how to use two api's same time
I got to figure it out tho
Gulsvi
@gulsvi
Apr 23 2017 18:30
@mbrien12 Can you share your code? It could be a lot of reasons
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:31
@keonsam anyway wanna take a look?
Shell Brien
@mbrien12
Apr 23 2017 18:32
@SkyCoder01 Sure! You can see it here https://github.com/mbrien12/learning-2017/tree/master/Free-code-camp/intermediate-front-end-projects/random-quote-machine but don't expect you to read through just looking for some pointers into right direction of documentation as feel like have gone through everything on Stack Overflow and hit bit of a wall
Gulsvi
@gulsvi
Apr 23 2017 18:33
@mbrien12 Looks like you are using the Twitter widget. That makes it a lot more challenging. You'll have to use their API to add the text to the button: https://dev.twitter.com/web/tweet-button/javascript-create
It would be much easier to remove the twitter widget code from your project and use a <a> tag. You can style that to look like a twitter button instead.
Shell Brien
@mbrien12
Apr 23 2017 18:34
Thanks @SkyCoder01 will give that a go!
CamperBot
@camperbot
Apr 23 2017 18:34
mbrien12 sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:star2: 1153 | @skycoder01 |http://www.freecodecamp.com/skycoder01
Keon Samuel
@keonsam
Apr 23 2017 18:37
it depends on the getJSON you might need promises.
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:44
.
huh
wait a minute...
I realized who is rudolp and texas banned him
Keon Samuel
@keonsam
Apr 23 2017 18:55
what?
Saboor Malik
@MathematicsCoding
Apr 23 2017 18:56
Remember who is rudolphh?
Keon Samuel
@keonsam
Apr 23 2017 18:57
no
Czpl
@Czpl
Apr 23 2017 19:04
the reindeer
Saboor Malik
@MathematicsCoding
Apr 23 2017 19:07
@Czpl what?
Gulsvi
@gulsvi
Apr 23 2017 19:07
Rudolphh was saying some very nasty things in chat
Saboor Malik
@MathematicsCoding
Apr 23 2017 19:07
oh
Gulsvi
@gulsvi
Apr 23 2017 19:07
Things I'm sure he wouldn't want people saying to his daughters
Saboor Malik
@MathematicsCoding
Apr 23 2017 19:08
I see
Why was he banned? instead of people who saying things to his daughters?
Czpl
@Czpl
Apr 23 2017 19:08
what :D
Gulsvi
@gulsvi
Apr 23 2017 19:09
No one said anything to his daughters lol
Saboor Malik
@MathematicsCoding
Apr 23 2017 19:09
oh lol
Gulsvi
@gulsvi
Apr 23 2017 19:09
He said some bad things, got banned. End of story.
Saboor Malik
@MathematicsCoding
Apr 23 2017 19:16
:clap:
Veronica
@veronicarbulu
Apr 23 2017 19:25
hello fellow campers! I am working on my portfolio page, but I have 3 issues I cannot resolve. I'd appreciate any guidance you might be able to offer: 1st issue: When looking at the page from my computer, the links/tabs on the top are not working properly. For instance, I click on the portfolio button, and it takes me there but not to the very top of the portfolio. 2nd issue: the same buttons on my navigation bar are not working when viewing the site on my iPhone. 3rd issue: I have a fixed navigation bar at the top of the page which works well when viewing the link from my laptop, but it doesn't work when viewing it from my cell phone. Any suggestions on how to fix these issues? Thanks in advance for your guidance. Here's a link to my portfolio page: http://codepen.io/veronicarbulu/pen/GmRQOK
Keon Samuel
@keonsam
Apr 23 2017 19:30
smoking.
Jorge
@OrangeKulture
Apr 23 2017 19:35
whats up guys
Keon Samuel
@keonsam
Apr 23 2017 19:36
whats popping?
aceroAD
@aceroAD
Apr 23 2017 19:37
img-responsive maker my img go left, ive been trying to make centered it but with the img-responsive i cant
Jorge
@OrangeKulture
Apr 23 2017 19:38
not much .. same ol
Saboor Malik
@MathematicsCoding
Apr 23 2017 19:40
@keonsam smoking?
:smoke
:smoking:
aceroAD
@aceroAD
Apr 23 2017 19:40
@veronicarbulu it takes u to the portfolio but becaus eu have afixed nav bar it look like if it goes under it
Keon Samuel
@keonsam
Apr 23 2017 19:41
@ I was talking to the lady. I don't smoke.
Tom
@moT01
Apr 23 2017 19:42
@veronicarbulu the first issue, ...its going to the right section, ...the very top of the section is just hidden behind the nav bar
aceroAD
@aceroAD
Apr 23 2017 19:43
@veronicarbulu i explain me so badly, the beggining of your portfolio is under your nav bars
Tom
@moT01
Apr 23 2017 19:43
you can adjust where it goes with javascript or jquery, ...not sure if there's a css way
yea, something like that would probly work
just some blank space in there
aceroAD
@aceroAD
Apr 23 2017 19:48
and using a span with the id u target
Alexander Auguste
@Digital920
Apr 23 2017 19:59
Hey I can't get my profile image to show up does anyone know why it isn't working? http://codepen.io/Lazarus155/pen/eWzXJO
Tom
@moT01
Apr 23 2017 20:00
@Digital920 cause your linking to an image on your hard drive
gotta upload it somewhere first, and link to there
Keon Samuel
@keonsam
Apr 23 2017 20:01
probably the script tag too.
zacharey
@zacharey
Apr 23 2017 20:01
Hello all, does anybody need any help with anything?
Keon Samuel
@keonsam
Apr 23 2017 20:01
sure
I need help with the tic tac toe AI.
Roxroy
@roxroy
Apr 23 2017 20:02
@Digital920 , it looks good, I do see any issues here.
zacharey
@zacharey
Apr 23 2017 20:02
what do you need?
Keon Samuel
@keonsam
Apr 23 2017 20:02
you finish your tic tac toe?
zacharey
@zacharey
Apr 23 2017 20:03
hmm… I can give it a shot…@keonsam What do you need help with?
Keon Samuel
@keonsam
Apr 23 2017 20:03
the AI.
zacharey
@zacharey
Apr 23 2017 20:03
what about it?
Keon Samuel
@keonsam
Apr 23 2017 20:03
minimax.
zacharey
@zacharey
Apr 23 2017 20:03
what are you trying to do
Keon Samuel
@keonsam
Apr 23 2017 20:04
let me see how you set it up.
Veronica
@veronicarbulu
Apr 23 2017 20:04
@moT01 thanks. How can I get it not to hide? I tried changing the margins and paddings but nothing seems to work. The other issue that this fixed nav bar doesn't work on my phone
CamperBot
@camperbot
Apr 23 2017 20:04
veronicarbulu sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 632 | @mot01 |http://www.freecodecamp.com/mot01
zacharey
@zacharey
Apr 23 2017 20:04
@keonsam I need to know what it is that you are trying to do
@veronicarbulu have you tried media queries
Veronica
@veronicarbulu
Apr 23 2017 20:06
@aceroAD yes. I'm wondering how to make it visible and not hidden. I also have issues seeing it on my phone. The tabs don't even work when I click them on my phone
zacharey
@zacharey
Apr 23 2017 20:07
were you answering to me or aceroAD @veronicarbulu
Tom
@moT01
Apr 23 2017 20:07
@veronicarbulu like i said javascript or jquery would probly be best, ...but without it you could just put a div above each section
with a set height maybe
and the id of the section
Veronica
@veronicarbulu
Apr 23 2017 20:08
@zacharey no, I have not tried that. I don't even know what that is. I'm trying to click on the buttons on the nav bar and have the respective section show up on the screen from the very beginning. The second issue is that the buttons on my nav bar do not work on my phone.
Keon Samuel
@keonsam
Apr 23 2017 20:08
@veronicarbulu you will need Jquery for that.
Tom
@moT01
Apr 23 2017 20:09
try using id instead of name, ...that might get it working on the phone
Veronica
@veronicarbulu
Apr 23 2017 20:09
@moT01 @moT01 Oh, I will need to include heigh for each section? Interesting... I was doing it for all the document
@moT01 you mean using ID instead of class?
@keonsam thanks. Haven't gotten to that section yet :(
CamperBot
@camperbot
Apr 23 2017 20:10
veronicarbulu sends brownie points to @keonsam :sparkles: :thumbsup: :sparkles:
:cookie: 336 | @keonsam |http://www.freecodecamp.com/keonsam
Tom
@moT01
Apr 23 2017 20:10
no, i mean name i think
your sections use name=about
thats what the buttons are linking to im guessing
id=about
Veronica
@veronicarbulu
Apr 23 2017 20:12
@moT01 ahh! ok. I'll try that. Thanks!
CamperBot
@camperbot
Apr 23 2017 20:12
veronicarbulu sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:warning: veronicarbulu already gave mot01 points
Tom
@moT01
Apr 23 2017 20:12
the height thing is kind of a hack, its just putting some blank space in there
zacharey
@zacharey
Apr 23 2017 20:13
@veronicarbulu I still do not have a clear understainding of what it is you want exactly but maybe this will help
https://www.w3schools.com/css/css_rwd_mediaqueries.asp
Veronica
@veronicarbulu
Apr 23 2017 20:14
@moT01 I'll try the height. I thought about it but put it for everything except the nav. I'll try including a height for each section and see.
@zacharey Thanks!
CamperBot
@camperbot
Apr 23 2017 20:14
veronicarbulu sends brownie points to @zacharey :sparkles: :thumbsup: :sparkles:
:cookie: 147 | @zacharey |http://www.freecodecamp.com/zacharey
zacharey
@zacharey
Apr 23 2017 20:15
let me know if it helps
Tom
@moT01
Apr 23 2017 20:15
@veronicarbulu probly shouldnt use an <a> tag for sections like that, ...use a div or span probly
waruwaruwaru
@waruwaruwaru
Apr 23 2017 20:21
can someone help me with a React Application, I cant get setInterval to work on my react application
Tom
@moT01
Apr 23 2017 20:22
@waruwaruwaru whats the problem
waruwaruwaru
@waruwaruwaru
Apr 23 2017 20:26

@moT01 when I use setInterval(function() { console.log("hello") }, 1000);

this works

but lets say I have a function that also have a console.log("hello") and if I pass in the function to the setInterval function, it does not call the console.log

componentDidMount() {
    this.currentImage();
    setInterval(function() { this.currentImage }, 1000);
  }


  currentImage() {
    console.log("debounce");
    if(this.imageIndex > 2) {
      this.imageIndex = 0;
    }
    var imageArray = [
      'http://www.3ddesktops.co.uk/file/118/2880x1800/crop/hearthstone-heroes-of-warcraft.jpg',
      'https://i.ytimg.com/vi/it3Mym3MyWs/maxresdefault.jpg',
      'http://www.hdwallpapers.in/walls/overwatch_4k-HD.jpg'
    ];

    this.setState({ currentImage: imageArray[this.imageIndex] });
    this.imageIndex++;
  }
the currentImage() function has a console.log output that is not being called continously. It is called once from this.currentImage(), but not from setInterval(function() { this.currentImage }, 1000);
Tom
@moT01
Apr 23 2017 20:28
got a pen ?
waruwaruwaru
@waruwaruwaru
Apr 23 2017 20:28
  componentDidMount() {
    this.currentImage();
    setInterval(function() { this.currentImage }, 1000);
  }


  currentImage() {
    console.log("debounce");
    // if(this.imageIndex > 2) {
    //   this.imageIndex = 0;
    // }
    // var imageArray = [
    //   'http://www.3ddesktops.co.uk/file/118/2880x1800/crop/hearthstone-heroes-of-warcraft.jpg',
    //   'https://i.ytimg.com/vi/it3Mym3MyWs/maxresdefault.jpg',
    //   'http://www.hdwallpapers.in/walls/overwatch_4k-HD.jpg'
    // ];
    // 
    // this.setState({ currentImage: imageArray[this.imageIndex] });
    // this.imageIndex++;
  }
I commented out the stuff
Tom
@moT01
Apr 23 2017 20:29
what about not putting function in the setInterval
setInterval(this.currentImage,1000);
not sure if you can declare a function like that, so it might not work with how currentImage is declared
is currentimage getting called the first time?
yes, i need to read
waruwaruwaru
@waruwaruwaru
Apr 23 2017 20:31
ok I did setInterval(this.currentImage,1000); I am getting the consolelog to print now
but now im getting a set.State is not a function now :(
currentImage() is being called continuously now. but getting "this.setState is not a function
at currentImage"
Yes
it works now
the problem is that i was not binding this
Tom
@moT01
Apr 23 2017 20:34
there ya go
waruwaruwaru
@waruwaruwaru
Apr 23 2017 20:36
thanks Tom, I don't know why I was passing a function into a function
I read on stackoverflow that if you pass in the function to setInterval, it gets the value of the function instead of passing in the function
thats why i did setInterval(function() { [inset function] }, 1000);
but i guess it works just passing in the function :)
Saboor Malik
@MathematicsCoding
Apr 23 2017 21:04
Do I have to use two document ready function if I want to access two different Api?
Tom
@moT01
Apr 23 2017 21:07
no
Saboor Malik
@MathematicsCoding
Apr 23 2017 21:08
Have you do twitch tv?
Tom
@moT01
Apr 23 2017 21:13
yes
Pagnito
@Pagnito
Apr 23 2017 21:13
@MathematicsCoding yo
Tom
@moT01
Apr 23 2017 21:14
do like some kind of test, check if theyre online with one request, and if they arent you need to make another one for the offline info or something @MathematicsCoding
Reeson55
@Reeson55
Apr 23 2017 21:14

hey guys im starting my first codepen project but my css styles arnt working is there anything I need to do to get this to work:

<h1> Tony Stark </h1>

<style>
h1 {color: red;}
</style>

Pagnito
@Pagnito
Apr 23 2017 21:15
hey so im on wher art thou, and im tryin to understand how to loop thru objects, i dont understand why im getting $ is not defined
Tom
@moT01
Apr 23 2017 21:19
@Reeson55 that looks like it should work, you should put the style in the css section
Roxroy
@roxroy
Apr 23 2017 21:19
@Pagnito , I don't see any issues with you pen, it prints the correct information. what problem are you having
Reeson55
@Reeson55
Apr 23 2017 21:20
@roxroy it actually worked in the html section but when i move it to css it doesnt
Tom
@moT01
Apr 23 2017 21:21
you wont need the <style> tags in the css section
Pagnito
@Pagnito
Apr 23 2017 21:24
@roxroy mine says $ is not defined in the console
alpox
@alpox
Apr 23 2017 21:26
>.< dammit my stupid tictactoe doesn't want to let me win
Keon Samuel
@keonsam
Apr 23 2017 21:28
alpox help me man.
Pagnito
@Pagnito
Apr 23 2017 21:29
@roxroy yea i got it now, for some reason jQuery cdn got take off my pen
alpox
@alpox
Apr 23 2017 21:29
@keonsam Whats up :D
Keon Samuel
@keonsam
Apr 23 2017 21:29
let me see how the code looks.
@keonsam Are you at tictactoe now too?
Keon Samuel
@keonsam
Apr 23 2017 21:32
yh
should I stop using var and use let and const?
alpox
@alpox
Apr 23 2017 21:37
@keonsam Its good to take that into consideration since var has often a rather weird behaviour - and let and const use the resources better so the compiler can do optimizations (Especially when using const)
No Name
@ilincicd
Apr 23 2017 21:50
Hey guys! How to remove these, what to write in CSS?
pitanje.jpg
Tom
@moT01
Apr 23 2017 21:52
those are dots from an unordered list?
No Name
@ilincicd
Apr 23 2017 21:52
yes
Tom
@moT01
Apr 23 2017 21:52
maybe dont make it a list and just make it some centered text
No Name
@ilincicd
Apr 23 2017 21:53
@moT01 Yes. I centered a list on site, but these points is on left side. How to hide this points|
?
Tom
@moT01
Apr 23 2017 21:54
i said if you don't make it a list, it won't show the dots
but i could look into seeing if you can remove the dots from a list, ...gotta be a way
No Name
@ilincicd
Apr 23 2017 21:54
@moT01 thanks
CamperBot
@camperbot
Apr 23 2017 21:54
ilincicd sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 633 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Apr 23 2017 21:55
list-style-type: none;
@ilincicd
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:03
ul {list-style-type: none;}
@Pagnito yo
Im still working on twitch tv :\
@Pagnito you finished roman numerals convertor?
about @Pagnito
CamperBot
@camperbot
Apr 23 2017 22:06
:cookie: 219 | @pagnito |http://www.freecodecamp.com/pagnito
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:06
Hm Im surpised that you found these solution
algorithm I meant
No Name
@ilincicd
Apr 23 2017 22:14
pitanje.jpg
How to centre this picture on nav bar?
What kind of code to type in CSS?
Tamas Csonka
@csnktms
Apr 23 2017 22:15
hey everyone, I have a todo list. I would like to apply a strike through to the element clicked on. Im using reactJS. what would be the best way?
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:15
body {
background-image: center;
}
I think
Use class instead
alpox
@alpox
Apr 23 2017 22:16
@csnktms text-decoration: line-through; is the css you can use
Tamas Csonka
@csnktms
Apr 23 2017 22:17
@alpox i know, i would be curious how to apply it to react, regarding the specific element. I would like to only target the li I clicked on.
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:18
@Pagnito you on
alpox
@alpox
Apr 23 2017 22:18
@csnktms Since you're using react, you have the state of the specific todo (usually). There should be a property defining if its done or not done. In the react render function you can then apply a class - in condition of the done/not done.
The class can be addressed by css to do the line-through
Tamas Csonka
@csnktms
Apr 23 2017 22:19
@alpox thanks!
CamperBot
@camperbot
Apr 23 2017 22:19
csnktms sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 966 | @alpox |http://www.freecodecamp.com/alpox
No Name
@ilincicd
Apr 23 2017 22:19
pitanje.jpg
Hey Guys! This is navigation bar. How to center this logo picture on center of nav bar? What kind of code I need to type in CSS?
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:19
@ilincicd i told you :\
body {
background-image: center;
}
alpox
@alpox
Apr 23 2017 22:19
@csnktms If you're interested in react/redux i just created a tictactoe based on them: http://codepen.io/alpox/pen/pPbMog?editors=0010
The code maybe looks bit ill if you didn't yet dive into redux
No Name
@ilincicd
Apr 23 2017 22:20
@MathematicsCoding It's not good. It's not my background image, and its not in body
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:20
Use class
No Name
@ilincicd
Apr 23 2017 22:20
I used, and nothing
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:20
That image is it in your div element?
Oh my bad... Try text-align
Keon Samuel
@keonsam
Apr 23 2017 22:21
yh it is impossible to get create this game with html/css/JS and Jquery.
No Name
@ilincicd
Apr 23 2017 22:21
@MathematicsCoding I tryed
nothing
Pagnito
@Pagnito
Apr 23 2017 22:21
@MathematicsCoding yp
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:21
@ilincicd ...
.center {
text-align: center;
}
Pagnito
@Pagnito
Apr 23 2017 22:22
@MathematicsCoding yo did u do where art thou
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:22
@Pagnito No :\ I think I gave up then I went back to twitch tv
I didnt know what to do lol
Pagnito
@Pagnito
Apr 23 2017 22:22
lol...ya i feel u...its takin ne alot of research
alpox
@alpox
Apr 23 2017 22:22
@Pagnito Whats the issue?
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:23
lmao
@Pagnito can you help me with twitch tv
I know you finished it but...
:\
Keon Samuel
@keonsam
Apr 23 2017 22:23
@alpox
yh it is impossible to create this game with html/css/JS and Jquery.
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:24
tic tac toe?
Keon Samuel
@keonsam
Apr 23 2017 22:24
yeah
alpox
@alpox
Apr 23 2017 22:24
@keonsam It surely is possible. Its just bit arkward :D
Pagnito
@Pagnito
Apr 23 2017 22:24
@a-d-collins well atm...im loopin thru the first argument and each object with for in...i dont know how to compare the 2nd argument with the key values of all the object keys im loopin thru
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:25
Eavesdropping
No Name
@ilincicd
Apr 23 2017 22:25
@MathematicsCoding You are saying text-align, and I am working with picture man, not with text
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:25
@ilincicd yes it still works
Pagnito
@Pagnito
Apr 23 2017 22:25
@MathematicsCoding ya i got...i think i should be done with this challlenge soon and ill help u
No Name
@ilincicd
Apr 23 2017 22:25
@MathematicsCoding I tried, NONE
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:25
@ilincicd let me see your code
Tamas Csonka
@csnktms
Apr 23 2017 22:25
@alpox thx, I will check it, btw what if I just modify the event.target.InnerHTML? it is working this way: event.target.style.color = 'red';
CamperBot
@camperbot
Apr 23 2017 22:25
csnktms sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:warning: csnktms already gave alpox points
alpox
@alpox
Apr 23 2017 22:25
@Pagnito This is a lot of looping and recall of object accessing
Tamas Csonka
@csnktms
Apr 23 2017 22:26
is there any way to modify the style.text-decoration?
No Name
@ilincicd
Apr 23 2017 22:26

@MathematicsCoding <!DOCTYPE html>

<html>
<head>
<title>Dobro dosli!</title>
<link rel="stylesheet" href=css/main.css>
<link href="https://fonts.googleapis.com/css?family=Shadows+Into+Light" rel="stylesheet">

</head>
<body>
<div id="wrapp">
<header>
<img class="sredjivanjePCS okvir-slike" src="img/logo.jpg" alt="">
<div class="clr">

</div>

<nav>
<ul>
<li>Home</li>
<li>O nama</li>
<li>Slike</li>
<li>Kontakt</li>
</ul>





</nav>





</header>

<article>

<section>
<div class="centriranje">

<img src="img/slika.jpg">

<p>Sa lijeva na desno:</p>
</div>

<div class="xxx">

<p><b>Ilincic Dario</b> - <em>bubnjevi</em></p>
<p><b>Milos Loncina</b> - <em>gitara i vokal</em></p>
<p><b>Aleksandar Djukic</b> - <em>bas gitara i prateci vokali</em></p </div>
</section>





</article>



<footer>

<h1> Music</h1>




</footer>
</div>
</body>
</html>

Saboor Malik
@MathematicsCoding
Apr 23 2017 22:26
add class to img element instead
alpox
@alpox
Apr 23 2017 22:26
@csnktms Yes it is possible but this is a hack and a total antipattern.
No Name
@ilincicd
Apr 23 2017 22:26
<img class="sredjivanjePCS okvir-slike" src="img/logo.jpg" alt="">
sredjivanjePCS is class for that pictuewe
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:26
<img src="url" class=""
Pagnito
@Pagnito
Apr 23 2017 22:26
@alpox if u look at my code, ull see right now im just learning whats what, so im just consoling stuff
alpox
@alpox
Apr 23 2017 22:26
@csnktms With react, you should NEVER manipulate any html directly
@Pagnito I would recommend not to use $.each for looping
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:28
@ilincicd so did you do this in css
.sredjivanjePCS {
text-align: center;
}
alpox
@alpox
Apr 23 2017 22:28
@Pagnito Use normal javascript functions instead
Pagnito
@Pagnito
Apr 23 2017 22:28
@alpox i tihnk i did it, if u look at my code now
No Name
@ilincicd
Apr 23 2017 22:29
@MathematicsCoding Yes, and nothing.
alpox
@alpox
Apr 23 2017 22:29

@Pagnito

 for(var key in item1){
      if(item1.hasOwnProperty(key)){

Here its clear that this if always holds true since the item1 provided you the key ;-)

Pagnito
@Pagnito
Apr 23 2017 22:29
@alpox i refreshed it, check it out
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:29
dude that should works im sure you did something wrong..
alpox
@alpox
Apr 23 2017 22:29
@Pagnito Hmm i still get the old version with $.each
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:29
Let me see your codepen.. I cant see your css
Tamas Csonka
@csnktms
Apr 23 2017 22:29
@alpox im a bit confused then, I am adding items to an array, which is mapped then and rendered. where should I add this property? Would u look into my code?
Pagnito
@Pagnito
Apr 23 2017 22:29
@alpox oh yea i literally just seen u say that a second ago
alpox
@alpox
Apr 23 2017 22:30
@csnktms You should add the property to the component state
Pagnito
@Pagnito
Apr 23 2017 22:30
@alpox how come not use $.each
No Name
@ilincicd
Apr 23 2017 22:30

@MathematicsCoding *{
margin:0;
padding:0;
}
@import url('https://fonts.googleapis.com/css?family=Shadows+Into+Light');
body{
background: #DCDCDC;
font-family: 'Shadows Into Light', cursive;

}

header{
background: #F8F8FF;

}

wrapp{

width: 90%;
margin:0 auto;

}

}
.clr{
clear: both;
}

nav ul{
list-style: none;

}
nav ul li{
display: inline-block;
width: 130px;
height: 30px;
line-height: 30px;
margin-right: 40px;
font-size: 1.8em;
}
nav ul li:first-child{
margin-left: 300px;
}
nav ul li:hover{
color:green;
cursor:pointer;
}

.okvir-slike{
border-color: black;
border-width: 5px;
border-style: solid;
border-radius: 50%;
align-items: center;
}

.centriranje{
text-align: center;

}
.xxx{
text-align: center;

}

nav img{
align-items: center;
}

.sredjivanjePCS {
text-align: center;
}

Tamas Csonka
@csnktms
Apr 23 2017 22:30
import React, { Component } from 'react';


class ToDoList extends Component {
  constructor(props) {
    super(props);
    this.state = {list: [], items: ''};
    this.handleChange = this.handleChange.bind(this);
    this.handleSubmit = this.handleSubmit.bind(this);
    this.handleRemove = this.handleRemove.bind(this);

  }

  handleChange(event) {
    this.setState({items: event.target.value})
    console.log(event.target.value);
  }

  handleSubmit(event) {
    this.setState({
      list: [...this.state.list, this.state.items],
      items: ''
    })
    event.preventDefault();
  }


  handleRemove(index) {
    const filteredArray = this.state.list.filter((_, i) => i !== index); // used underscore as a convention to address nothing is going there
    this.setState({
      list: filteredArray
    });
  }


  render() {
    return (
    <div className='header main'>
      <form onSubmit={this.handleSubmit} >
        <label>
          <input className='new-todo'
            placeholder='What needs to be done?'
            type="text"
            value={this.state.items}
            onChange={this.handleChange} />
        </label>
      </form>
      <ul className='todo-list'>
        {this.state.list.map((item, index) => (
            <li onClick={this.doneTodo} className='list-view' key={index+1}>{item}<button className='list-view-button' onClick={this.handleRemove.bind(this, index) }>X</button></li>
        ))}
      </ul>
      <div className='footer'>
      Remaining: {this.state.list.length}
      </div>
      </div>
    );
  }
}

export default ToDoList;
@alpox;
alpox
@alpox
Apr 23 2017 22:30
@Pagnito Its a jquery method and jquery is going to be used less and less. Also, its good to know how to achieve things with normal javascript - i'm not even sure that jquery is allowed in the fcc algos
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:31
about @ilincicd
CamperBot
@camperbot
Apr 23 2017 22:31
:warning: no user found for ilincicd
Reeson55
@Reeson55
Apr 23 2017 22:32
for some reason my Tony Tark Text isnt taking on the google Font. can someone help me please?
Pagnito
@Pagnito
Apr 23 2017 22:32
@alpox oh, so should i use a normal for loop to go thru the array
alpox
@alpox
Apr 23 2017 22:32
@csnktms The property would come into the single elements of the objects in list
Pagnito
@Pagnito
Apr 23 2017 22:32
@alpox or forEach
No Name
@ilincicd
Apr 23 2017 22:32
@MathematicsCoding I solved on my way
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:33
@ilincicd
No Name
@ilincicd
Apr 23 2017 22:33

@ilincicd Solution is : header{
background: #F8F8FF;
text-align: center;

}

alpox
@alpox
Apr 23 2017 22:33
@Pagnito You can use for(let key in collection) or the new for(let value of collection) as well as Object.keys(collection).forEach(...) or the new Object.values(collection).forEach(...)
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:33
Its because there is two class
With text-align: center;
alpox
@alpox
Apr 23 2017 22:33
@Pagnito As you see, there are options :-)
No Name
@ilincicd
Apr 23 2017 22:33
@MathematicsCoding thanks
CamperBot
@camperbot
Apr 23 2017 22:33
ilincicd sends brownie points to @mathematicscoding :sparkles: :thumbsup: :sparkles:
:cookie: 343 | @mathematicscoding |http://www.freecodecamp.com/mathematicscoding
Pagnito
@Pagnito
Apr 23 2017 22:33
@alpox so what does Object.keys() do, i thought it just returned keys of an object
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:34
I dont think I was trying helping you but no problem :) @ilincicd
No Name
@ilincicd
Apr 23 2017 22:34
@MathematicsCoding I wasted yout time :)
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:34
Its all right
No Name
@ilincicd
Apr 23 2017 22:34
Best regards! Bye
alpox
@alpox
Apr 23 2017 22:35
@Pagnito It returns an array of all keys in the object
Pagnito
@Pagnito
Apr 23 2017 22:35
@alpox with the values?
alpox
@alpox
Apr 23 2017 22:35
@Pagnito No just keys
Reeson55
@Reeson55
Apr 23 2017 22:35
hey guys how do i post my codepen?
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:35
@Reeson55 just post the link
They will show up anyway
Reeson55
@Reeson55
Apr 23 2017 22:35
https://codepen.io/Reeson55/pen/pPbMPN
can someone tell me why the google font for the title tony starking isnt working
Saboor Malik
@MathematicsCoding
Apr 23 2017 22:36
ah tony stark
Pagnito
@Pagnito
Apr 23 2017 22:36
@alpox oh so thus object.values?
alpox
@alpox
Apr 23 2017 22:36

@Pagnito You'd usually do something like:

Object.keys(collection).forEach(key => {
    let value = collection[key];
    ....
});

Or as you say, if you just want all values you can use Object.values instead

Also, for(let value of collection) also loops through all values
Pagnito
@Pagnito
Apr 23 2017 22:37
@alpox k, sweet thanks
CamperBot
@camperbot
Apr 23 2017 22:37
pagnito sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 967 | @alpox |http://www.freecodecamp.com/alpox
alpox
@alpox
Apr 23 2017 22:38
@Pagnito Btw. collection is an object in this case (not the array)
I just noticed that the name was maybe confusing
Pagnito
@Pagnito
Apr 23 2017 22:39
yup got it