These are chat archives for FreeCodeCamp/HelpFrontEnd

29th
Dec 2016
dwquach
@dwquach
Dec 29 2016 00:06
@c0d0er2 you don't need the +1 at the end of you code. myVar++ automatically increments by 1
c0d0er2
@c0d0er2
Dec 29 2016 00:06
@dwquach Thanks
CamperBot
@camperbot
Dec 29 2016 00:06
c0d0er2 sends brownie points to @dwquach :sparkles: :thumbsup: :sparkles:
:cookie: 275 | @dwquach |http://www.freecodecamp.com/dwquach
dwquach
@dwquach
Dec 29 2016 00:22
what's your issue with it?
never mind. I see that you got help at the other help chat haha
dwquach
@dwquach
Dec 29 2016 00:32
I have another issue. I want the background image to change every time the "new button" is clicked. I've put what I thought would work in the first line of the success header but with no success. https://codepen.io/dwquach/pen/XNwoYL
Tyler Moeller
@TylerMoeller
Dec 29 2016 00:52
@dwquach Since you're using the same URL every time, the browser thinks you are asking for the same image again and just gives you the cached version it already gave you when you loaded the page. With Unsplash, you can add ?sig={random number} to the end of the url to prevent this, for example:
$("body").css("background-image", "url(" + "https://source.unsplash.com/category/nature?sig=" + Math.random() + ")");
More info: unsplash/unsplash-source-js#9
quackidy
@quackidy
Dec 29 2016 00:55
Hi guys! Could someone help me with getting my name and the buttons to align on the nav bar?
http://codepen.io/cassidyepps/pen/woZjqj
Idowu Wasiu
@Hoxtygen
Dec 29 2016 01:08
@c0d0er2 what are you having problem with
c0d0er2
@c0d0er2
Dec 29 2016 01:17
@Hoxtygen i need help on Quoting Strings with Single Quotes in javascript
Idowu Wasiu
@Hoxtygen
Dec 29 2016 01:17
@c0d0er2 wheres your code?
dwquach
@dwquach
Dec 29 2016 01:17
@quackidy i was messing around with your code and with some googling i found a half answer. i added position:absolute and bottom: 0 to the css code to the h2 element (you can use an id/class instead) it aligns the text and the buttons however it also alters the size of your nav bar which i'm not sure if you're okay with
Ken Haduch
@khaduch
Dec 29 2016 01:19
@quackidy - you just have an <h2> element for your name. The display style for that is display:block; which makes it occupy its own line. Try changing it to something else. Or putting a class on it with display: inline-block;
Also, are you using Bootstrap grid row/columns? The col-s-3 is not correct, it should be col-sm-3, for all of those, I think? Unless you're trying to do something else.
c0d0er2
@c0d0er2
Dec 29 2016 01:19
@Hoxtygen
var myStr = "<a href='"http://www.example.com'" target='"_blank'">Link</a>";
Idowu Wasiu
@Hoxtygen
Dec 29 2016 01:20
@c0d0er2 reset the code pls, its all cluttered
c0d0er2
@c0d0er2
Dec 29 2016 01:20
@Hoxtygen ok
Idowu Wasiu
@Hoxtygen
Dec 29 2016 01:20
@c0d0er2 everything as they were and judt change the first and last quote to single quote
c0d0er2
@c0d0er2
Dec 29 2016 01:21
@Hoxtygen Thanks!
Idowu Wasiu
@Hoxtygen
Dec 29 2016 01:22
@c0d0er2 :thumbsup:
dwquach
@dwquach
Dec 29 2016 01:35
@TylerMoeller that worked like a charm. Thanks!
CamperBot
@camperbot
Dec 29 2016 01:35
dwquach sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1216 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Ken Haduch
@khaduch
Dec 29 2016 01:37
@quackidy - maybe you should try to use the Bootstrap navbar, they have boilerplate code on their site...
Segun Samuel
@shegs-a
Dec 29 2016 01:44
Hello guys, I'm trying to vertically align a div within a div. the goal is to place the inner div at the vertical center of the outer div. What's the best way to carry this out? Both Bootstrap and jQuery solutions are welcome
Update: I'm beginning to lose my head here.....lol
Ken Haduch
@khaduch
Dec 29 2016 01:47
@shegs-a - use flexbox, probably that's the answer.
Segun Samuel
@shegs-a
Dec 29 2016 01:48
@khaduch flexbox...hmmn. Any resources on flexbox that you can share? Need to finish this part of my project.
Ken Haduch
@khaduch
Dec 29 2016 01:52
@shegs-a - http://flexboxfroggy.com/ - a "game" that teaches you about the various flexbox settings. Also you can probably check w3schools.com for information, and Wes Bos has a free (I think) set of lessons on flexbox http://flexbox.io/. I haven't tried that, yet, still in progress on another one of his courses, but based on the other course, I would probably recommend it.
willstanleyus
@willstanleyus
Dec 29 2016 02:04
Hello room,
API question
Ken Haduch
@khaduch
Dec 29 2016 02:07
@willstanleyus - fire away, we'll try to help...
willstanleyus
@willstanleyus
Dec 29 2016 02:09
went to https://github.com/FreeCodeCamp/open-api and it said to go to FreeCodeCamp/DataScience Gitter for API request. But... reading the traffic, it looks like this is the wrong place. @khaduch
Ken Haduch
@khaduch
Dec 29 2016 02:12
@willstanleyus - sorry, I don't know anything about that - maybe someone else on here will have some info? You're right that it doesn't look like the DataScience room is of any use?
willstanleyus
@willstanleyus
Dec 29 2016 02:13
Thanks @khaduch . I will ping the main help room.
CamperBot
@camperbot
Dec 29 2016 02:13
willstanleyus sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2177 | @khaduch |http://www.freecodecamp.com/khaduch
c0d0er2
@c0d0er2
Dec 29 2016 02:51
Can somebody please help me with getting 2 images seperate? https://codepen.io/c0d0er2/pen/oYrppg
Victor
@VictorHall
Dec 29 2016 02:53
Hi can someone help me
Tom
@moT01
Dec 29 2016 02:54
@VictorHall whats up
Victor
@VictorHall
Dec 29 2016 02:56
@moT01 thanks, Im stuck on the "smallest common multiple" challenge
CamperBot
@camperbot
Dec 29 2016 02:56
:cookie: 440 | @mot01 |http://www.freecodecamp.com/mot01
victorhall sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
Tom
@moT01
Dec 29 2016 02:56
and
Victor
@VictorHall
Dec 29 2016 02:57
right here is my code
@moT01
Tom
@moT01
Dec 29 2016 02:58
yea i think that one was probly the hardest in the intermediate section
Victor
@VictorHall
Dec 29 2016 02:59
yes it pretty challenging
my problem is on line 23
i cant commute the last to conditions [1,13] and [23, 18]
Tom
@moT01
Dec 29 2016 03:00
so it works for the other tests?
Victor
@VictorHall
Dec 29 2016 03:01
on line 23 i compute values in my loop greater than 100000
it completely crashes
yes
[1,5] returns 60 in my final array
if i could compute values greater than 100000 it would work
Tom
@moT01
Dec 29 2016 03:02
when you try to compute up to 100000 it crashes, ...it says 10000 as i see it
Victor
@VictorHall
Dec 29 2016 03:02
yes but change it
it will crash
Tom
@moT01
Dec 29 2016 03:03
still wouldn't work for that last test, ...6million
or the second to last one
i was having a similar issue if i recall, ...might need to find another way to go about it
Victor
@VictorHall
Dec 29 2016 03:05
yea
i will have too. I just dont know how i will compute values that large
or even test for smaller values
@moT01
Tom
@moT01
Dec 29 2016 03:07
i could show you my solution if you want, ...trying to go through your code and see if i can find a way to optimize it better
Victor
@VictorHall
Dec 29 2016 03:09
i dont want the solution just yet
Tom
@moT01
Dec 29 2016 03:09
you are making some huge arrays on that line
Victor
@VictorHall
Dec 29 2016 03:11
yes but in line 32 i condense it to values that both arrays have in common
i put them into the leastCommon arrawy
*array
Mitchell Stewart
@mitchstewart08
Dec 29 2016 03:11
why are you looping that high
Victor
@VictorHall
Dec 29 2016 03:14
@mitchstewart08 how am i going to test which values are multiples of all values in the range if i can reach that value ?
I need to reach that value in line 23
then in 32 it is condensed into values that both are arrays have in common
Tom
@moT01
Dec 29 2016 03:15
i think youre going about it the wrong way, ...that's whats causing the problem
youre using too much memory or processor or whatever it is
creating and going through those huge loops is too much
Mitchell Stewart
@mitchstewart08
Dec 29 2016 03:16
yeah
it's almost worse than O(n^2)
Tom
@moT01
Dec 29 2016 03:17
i started with an array of the numbers in the range
Victor
@VictorHall
Dec 29 2016 03:19
@mitchstewart08 lol i know its bad
@moT01 okay
ill give it another shot
Tom
@moT01
Dec 29 2016 03:21
not that bad
it would work
if you had a super computer
maybe
Victor
@VictorHall
Dec 29 2016 03:22
@moT01 thanks
CamperBot
@camperbot
Dec 29 2016 03:22
victorhall sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:warning: victorhall already gave mot01 points
Tom
@moT01
Dec 29 2016 03:23
one way to maybe limit the loops performed would be to start a loop at all the numbers in the range multiplied by each other
i dont think i did that, but pretty sure it would work
wait, maybe not
something along those lines might help
John Nunns
@johnnunns
Dec 29 2016 03:30
Any js experts on ?? :)
Tom
@moT01
Dec 29 2016 03:30
im no expert, but i can try to help if you want
John Nunns
@johnnunns
Dec 29 2016 03:31
@moT01 I'm on the Record Collection problem
And I'm struggling badly
quackidy
@quackidy
Dec 29 2016 03:32
Thank you so much @dwquach and @khaduch
CamperBot
@camperbot
Dec 29 2016 03:32
quackidy sends brownie points to @dwquach and @khaduch :sparkles: :thumbsup: :sparkles:
:cookie: 277 | @dwquach |http://www.freecodecamp.com/dwquach
:star2: 2178 | @khaduch |http://www.freecodecamp.com/khaduch
Tom
@moT01
Dec 29 2016 03:34
yea, can you be more specific at all? have any code to show?
Ken Haduch
@khaduch
Dec 29 2016 03:41
@johnnunns - please post your code. It's not really too difficult once you get going in the right direction.
John Nunns
@johnnunns
Dec 29 2016 03:41
function updateRecords(id, prop, value) {
  if(collection.tracks.hasOwnProperty()){
    return collection;
  }else if (collection.tracks.hasOwnProperty === false){
    collection.tracks.push
  }
It's very unfinished, I'm not sure if I'm headed in the right direction
Ken Haduch
@khaduch
Dec 29 2016 03:42
@johnnunns - one question - does collection have a tracks property, ever? What kind of properties does collection have - the "first level" of properties. For that matter, what kind of structure is collection?
John Nunns
@johnnunns
Dec 29 2016 03:44
I guess what you're telling me is that the tracks property belongs to the id which is the record number. correct?
so if I were going to push, it'd have to be collections.2548.tracks.push()
Ken Haduch
@khaduch
Dec 29 2016 03:45
probably that's what I'm telling you, so if you have a collection, and an id, what would you do with that to try and find a tracks property? Your answer is close, but you have to make sure that you understand when you can use dot notation vs. bracket notation to access an object.
John Nunns
@johnnunns
Dec 29 2016 03:46
alright. lets rework. Thanks @khaduch. mini lightbulb
CamperBot
@camperbot
Dec 29 2016 03:46
johnnunns sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2179 | @khaduch |http://www.freecodecamp.com/khaduch
Tom
@moT01
Dec 29 2016 03:46
say @khaduch, how my clock look?
http://codepen.io/moT01/pen/PbrzQo
John Nunns
@johnnunns
Dec 29 2016 03:49
@khaduch
function updateRecords(id, prop, value) {
  if(collection["1245"].tracks.hasOwnProperty()){
    return collection;
  }else {
    collection['1245'].tracks.push("Don't know")
  }
Tom
@moT01
Dec 29 2016 03:49
@johnnunns use the parameters, they will be different each time
Ken Haduch
@khaduch
Dec 29 2016 03:50
@johnnunns - okay, that might work, but remember that you are getting different id values, and those values will be the numbers, so you should be able to use that variable in your data access.
Tom
@moT01
Dec 29 2016 03:51
@johnnunns check out the syntax on the .hasownprop method
should be a link on that exercises page
John Nunns
@johnnunns
Dec 29 2016 03:51
function updateRecords(id, prop, value) {
  if(collection["1245"].tracks.hasOwnProperty(prop)){
    return collection;
  }else {
    collection['1245'].tracks.push("Don't know");
  }
better?
Tom
@moT01
Dec 29 2016 03:53
check out kens last message
1245 won't be 1245 every time
John Nunns
@johnnunns
Dec 29 2016 03:55
why won't it always be 1245?? @moT01
Ken Haduch
@khaduch
Dec 29 2016 03:56
@johnnunns - first things first - you HAVE TO USE THE id - there is no way to make it work otherwise! Check the test cases that will be run to validate your solution.
Tom
@moT01
Dec 29 2016 03:56
if you hit the runtests button, you will see the different tests you need to pass
Ken Haduch
@khaduch
Dec 29 2016 03:59
@moT01 - Pomodoro... Why did you decide to wrap from 1 to 99 when decrementing the session count? And break count. I don't think it's a bad idea, just a surprise.
John Nunns
@johnnunns
Dec 29 2016 03:59
I know I have different tests, I just want to make sure I'm on the right track before I start the others. @moT01 @khaduch am I not using the id when i write 1245?
Tom
@moT01
Dec 29 2016 04:00
no, @johnnunns you need to use the parameter sent to the function
youre using AN id, but not always the right one
Ken Haduch
@khaduch
Dec 29 2016 04:01
@johnnunns - you are using an ID value that is in the data, that might be true, but you should just use the variable id because when you call the function, as they have one sample call at the bottom of the edit window, that value will be avaiable in the id variable and you'll be using it in the way that will be a general-purpose solution. But, for the sake of argument, you are using one of the values. So let's move on to the next thing. If you have this construct: collection["1245"] - what does that allow you to access within the data?
Tom
@moT01
Dec 29 2016 04:02
im not sure why i went that way, @khaduch
i suppose i coulda went to 59
@khaduch originally i was going to have seconds and hours, and made some html and js that i knew for it, ...but when it came to the interval (only thing i couldn't do) i was trying to do too much, too fast, so i had to simplify
it was 59 right away for the seconds, and when i deleted the seconds i changed it to 99 for some reason
John Nunns
@johnnunns
Dec 29 2016 04:06
only the "1245" id @khaduch
Ken Haduch
@khaduch
Dec 29 2016 04:06

@moT01 - well, it's better than counting into the negative values, I've seen that. So the next question is that I didn't hear any sound when it changed from the session to the break? I think that is one of the requirements, they mention it in the user stories, I think?
One other thing, and if you have it working, it's fine - it's easier to keep your time value in seconds only, and not have to make calculations against seconds and minutes.

But it looks good overall!

@johnnunns - right - but that's not what I'm after. If you have that collection["1245"], how would you determine whether or not it has a tracks property?
Tom
@moT01
Dec 29 2016 04:07
@johnnunns correct, you need to get and whatever id is sent to the function
get at*
John Nunns
@johnnunns
Dec 29 2016 04:08
by adding the .hasOwnProperty
@khaduch
Tom
@moT01
Dec 29 2016 04:10
know of a good place where there's some audio files i can use?
Ken Haduch
@khaduch
Dec 29 2016 04:10
@johnnunns - ookay - so in your code, you have this: collection["1245"].tracks.hasOwnProperty(prop) - what is that going to tell you? Is it correct? (I would say that tracks might be there, it might not be there, and if it is there, it needs to be an array, as many of the records are initialized with an array.) But does an array have properties?
@moT01 - I've heard some really strange audio files being played on some of these timers! I don't know the best place to find them - google "free audio files" or something like that.
John Nunns
@johnnunns
Dec 29 2016 04:11
Well in the problem, 1245 already has the tracks property, but no value @khaduch
i can see where the other one, 5439, would need to be asked if it has the property in the first place

// Setup
var collection = {
    "2548": {
      "album": "Slippery When Wet",
      "artist": "Bon Jovi",
      "tracks": [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    "2468": {
      "album": "1999",
      "artist": "Prince",
      "tracks": [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    "1245": {
      "artist": "Robert Palmer",
      "tracks": [ ]
    },
    "5439": {
      "album": "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
  if(collection[1245].tracks.hasOwnProperty(value)){
    return collection;
  }else {
    collection[1245].tracks.push("Addicted to Love");
  }
  if(collection[5439].hasOwnProperty(prop)) {
    return collection;
  }else if(collection[5439])
  }
Tom
@moT01
Dec 29 2016 04:13
oh boy
Ken Haduch
@khaduch
Dec 29 2016 04:13
@johnnunns - hmmm - it looks like they changed the data ffrom the last time I looked at it. I don't remember that they had one with an empty array. Okay...
John Nunns
@johnnunns
Dec 29 2016 04:13
sorry I didn't just repost in the first place @khaduch
Tom
@moT01
Dec 29 2016 04:13
@johnnunns hint: there shouldn't be any testing of the actual id numbers
just the variable id
that variable will hold the id that you need to test
John Nunns
@johnnunns
Dec 29 2016 04:14
How will it know which ID to go to though?
Tom
@moT01
Dec 29 2016 04:15
it just knows
John Nunns
@johnnunns
Dec 29 2016 04:15
like if just wrote collection[id]... <- that would apply to multiple ones. So I may add the song to multiple ids
Tom
@moT01
Dec 29 2016 04:15
the value of id, will be an ID number
no, that will only be a single id number, ...look at the tests, theres never two id's passed
Ken Haduch
@khaduch
Dec 29 2016 04:16
@johnnunns - but regardless of whether it has one or not, you have to look at the general case - if you are going to just add a property to an object, that is simple to do with object.newProperty = "something"; for example. If you want to add something to an array, as with this problem, you have to use .push(), which you know. But again, in the general case, you have to make sure that there is an array there in order to push. So you cannot just do object.someOtherProperty.push("something"); if there isn't a someOtherProperty that doesn't contain an array. For the general case, you want to make sure that there is or isn't a property for the "tracks" case so you can properly create it if necessary, and .push() to it if it exists.
Tom
@moT01
Dec 29 2016 04:18
@khaduch thanks for looking at my clock
CamperBot
@camperbot
Dec 29 2016 04:18
mot01 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2180 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
Dec 29 2016 04:18
@johnnunns - this seems to be a concept that you aren't clear on - there will be multiple tests run. Each time, one ID value will be passed to indicate which record to work on. the function argument id will contain that value, and you can use it as collection[id], and your code has to be written to just handle the other cases - for example, if value === '' is one of the things that they mention - the specific record that you have the ID for is the one that will be tested. It will work!
@moT01 - you're welcome..
@johnnunns - and, by the way, this problem is a stepping stone from some of the simpler concepts that were presented in the earlier lessons and challenges. It does take things to a new level, and many people have trouble getting this! But once you get it, you'll be able to do greater things in JavaScript... :)
Tom
@moT01
Dec 29 2016 04:25

@johnnunns when you call...
updateRecords(5439, "tracks", "");
those values get plugged into your variable...
updateRecords(id, prop, value);

so using collection[id], in this case, will give you access to the collection with the id of 5439
maybe you already got that part, trying to bring more clarity

John Nunns
@johnnunns
Dec 29 2016 04:26
sorry had a kitchen crisis :). Ok let me read what you wrote 20 times and try and let it sink in haha @khaduch @moT01
ok, I think i see what you're saying, no need to write the actual specific id, because it will be found through testing. Let me see if I can apply it
Ken Haduch
@khaduch
Dec 29 2016 04:30

@johnnunns - one example of one of these tests - the first one:

updateRecords(5439, "artist", "ABBA");

Your function will be called - the function arguments will be:

  • id = 5439
  • prop = "artist"
  • value = "ABBA"

The test says that after the function runs:

artist should be "ABBA"

So the testing code is going to read the collection object that is returned. Before your function runs, that record doesn't have an artist field. But you will add it, and since it is not a tracks property, no need to worry about array-type structures, you can just set that property using the variables and bracket notation - collection[id][prop] = value; That's a hint...
It is equivalent to having the code collection["5439"].artist = "ABBA"; but it is reusable because it is parameterized with the function arguments that will assume the values for the current function invocation.

John Nunns
@johnnunns
Dec 29 2016 04:35
ok I hit the wall again. Tell me this. And I'm sorry I'm sure you've already answered but there's a disconnect somewhere for me. So if you have collection[id].hasOwnValue <-the else if statement will apply to multiple ids and then won't I be pushing the same song or artist to multiple ids? It seems if I don't specifically say the id number, I can't stop the push from going to multiple spots.
Zaurbek Zhakupov
@zzhakupov
Dec 29 2016 04:35
Hello guys can I have some feedback on my conway's game of life project http://codepen.io/Zooll/pen/XNoRNY
John Nunns
@johnnunns
Dec 29 2016 04:35
@khaduch
man coding is a humbling experience for my perceived intelligence :))
Andrew Thompson
@zovaaa
Dec 29 2016 04:39
Where's the best place for some help with the wikipedia project? I can't for the life of me work out how to get the correct snippet for the results (i.e., search 't' and check the snippets) codepen: http://codepen.io/zovaaa/pen/eBMMxX
currently using this link: https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=${query.value}&format=json&origin=*
Tom
@moT01
Dec 29 2016 04:39
@johnnunns think of whats there, ...if you put if (collection[id].hasOwnProperty('someproperty');
Ken Haduch
@khaduch
Dec 29 2016 04:40
@johnnunns - it is .hasOwnProperty(), I think that's what you meant? And the point is that you want to be able to work on multiple records. The thing is, that the function is only called with one value at a time - so for each invocation of the function, you'll probably be using different values, but ONLY ONE AT A TIME! That's the beauty of it! You can, of course, have something that would take action on all of the records in the collection, say, if you wanted to add another field - but you'd have to be getting multiple pieces of data in an array or something - so calm yourself. :) It will work, I promise!
Tom
@moT01
Dec 29 2016 04:40
youre asking if the collection with that id has that property
it will only be that one id, because that variable is a single id
@zovaaa is that how you put a variable in a string?
ive always used the " + variable + ".com" style
but maybe your way works
Andrew Thompson
@zovaaa
Dec 29 2016 04:44
Yeah, if you use backticks you can make it so `${variable}.com`
= variable + '.com'
Tom
@moT01
Dec 29 2016 04:45
yea, figured that
John Nunns
@johnnunns
Dec 29 2016 04:46

```
function updateRecords(id, prop, value) {
if(collection[id].tracks.hasOwnProperty(value)){
return collection;
}else {
collection[id].tracks.push("Addicted to Love");
}
if(collection[id].hasOwnProperty(prop)) {
return collection;
}else {
collection[id].push("tracks","artists");
}

}

``` @khaduch @moT01

function updateRecords(id, prop, value) {
  if(collection[id].tracks.hasOwnProperty(value)){
    return collection;
  }else {
    collection[id].tracks.push("Addicted to Love");
  }
  if(collection[id].hasOwnProperty(prop)) {
    return collection;
  }else {
    collection[id].push("tracks","artists");
  }






}
Tom
@moT01
Dec 29 2016 04:46
@zovaaa the url gives results
but not the results you want?
@johnnunns if collection['1245'].tracks.hasOwnProperty("artist")
John Nunns
@johnnunns
Dec 29 2016 04:51
function updateRecords(id, prop, value) {
  if(collection[id].tracks.hasOwnProperty(value)){
    return collection;
  }else {
    collection[id].tracks.push(value);
  }
  if(collection[id].hasOwnProperty(prop)) {
    return collection;
  }else {
    collection[id].push("tracks","artists");
  }
replaced the specific song with 'value'
Tom
@moT01
Dec 29 2016 04:51
how can tracks have the property of artist
John Nunns
@johnnunns
Dec 29 2016 04:53
well would it be collection[id].hasOwnProperty("tracks") then?
Andrew Thompson
@zovaaa
Dec 29 2016 04:54
Yes, mine give incorrect description snippets when compared to the example
Tom
@moT01
Dec 29 2016 04:56
@Zooll8 im not sure what's supposed to be happening, but it seems to get stuck after a while
what is incorrect? @zovaaa its giving me a description
i would probly just go with that
but if youre looking for something else, ...it might be the list=search
yea, i played around with that for a while, ...if youre interested
http://codepen.io/moT01/pen/LRoxrQ?editors=1010
here's what i came up with
Ken Haduch
@khaduch
Dec 29 2016 05:00

@johnnunns - there are a few problems here.

  • you should be testing for value === '' or value !== '' somewhere in your code to be able to handle that situation, as described in the problem description
  • collection[id].tracks.hasOwnProperty(value) - this is not correct. tracks does not contain an object as its value, so it cannot be used with .hasOwnProperty() in the way you have it coded. (You would most likely get an error in the console if you looked at it when this code was attempted to be run.)
  • collection[id].tracks.push("Addicted to Love"); would work - if prop === "tracks" (you were supposed to be operating on the "tracks" property) and if value === "Addicted to Love" - In other words, you have hard-coded something that should be using the function arguments.
  • if(collection[id].hasOwnProperty(prop)) { - this test is not useful here. The function should always return collection; after it updates the record.
  • collection[id].push("tracks","artists"); - this is also not useful here - there is no condition here where you should be pushing the words "tracks" and "artists" into an object (which probably will fail anyway, since it collection[id] is not an array...

You have some of the concepts going in the right direction, but things are quite jumbled and confused, but let's try another approach. Look at the conditions that they want you to check - one of the biggies is value === "" or value !== "". If the value is blank, you are just supposed to delete the property that is given in the variable prop, at the ID that is given in the variable id. You have to use the delete function. You can write this code like this:

if ( value === '' ) {
    delete collection[id][prop]; // because the value is blank, just delete this
} else {
    // the value is not blank - there are other things to consider, most specifically, if `prop === "tracks"`
    if (prop === "tracks" ) {
        // do the things here to properly handle the "tracks" property
    } else {
        // the prop variable is not "tracks", just add the prop and value to the given record.
    }
}
return collection; // this is always done at the end of the function

that is what you should have as a basic idea for your function - you need to fill in the details. Look at the description of the problem, with this framework in mind, and see if you can get some of the tests to pass.

Tom
@moT01
Dec 29 2016 05:04
@khaduch wow
Ken Haduch
@khaduch
Dec 29 2016 05:05
@johnnunns @moT01 - I hate to be a party pooper, but I have to sign off for tonight. That's why I put so much detail & hints into my previous comment... 5 minutes for any followup?
Tom
@moT01
Dec 29 2016 05:05
that's like a whole novel
John Nunns
@johnnunns
Dec 29 2016 05:05
huge thanks for your patience. Both @khaduch and @moT01 . I'll give it a shot. And thanks for going into that much detail for me. Means a ton
CamperBot
@camperbot
Dec 29 2016 05:05
johnnunns sends brownie points to @khaduch and @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 441 | @mot01 |http://www.freecodecamp.com/mot01
:star2: 2181 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
Dec 29 2016 05:08
@johnnunns - as I said - this is a big stepping stone in writing a function that does something a little more complex than the problems up until this point. It's not good to just have the answer given to you, but it's not good to get too frustrated. I hope that helps. You can always find hints in the wiki, if you get too bogged down, but people here will help you, it's better to try and make it through and learn as much as you can. Step, step, step... good luck!
khaduch @khaduch - going offline for the night... going once... going twice... gone! Good night all - happy coding!
Josh
@joshfilippi
Dec 29 2016 05:20
Can anyone help me get bootstrap working? I've just finished all the functionality of my local weather project and now i can't get button in the right place
There is a button under the temperature. I want it to be beside it
Bootstrap is loaded on the pen, everything is nested in a container-fluid element. but when i nest 2 elements in a 'row' class element, they dont appear in a row
Tom
@moT01
Dec 29 2016 05:24

adding...

#temp {
  display: inline;
}

gets it close

@joshfilippi
livonian-router
@livonian-router
Dec 29 2016 05:27
@joshfilippi and round your temp result
Josh
@joshfilippi
Dec 29 2016 05:28
@moT01 thanks. it's a little better. I'd love to know why bootstrap grid isnt working
CamperBot
@camperbot
Dec 29 2016 05:28
joshfilippi sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 442 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Dec 29 2016 05:30
im not great with bootstrap, there might be a better way with one of their classes, ...i might consider just turning you <p> with the temp in it to something clickable, and use that to toggle instead of a separate button
DavidMinAZ
@DavidMinAZ
Dec 29 2016 05:33
@someone Anyone up for tackling a jQuery question? I'm trying to grab some jSON data using .getJSON() but although the API is clearly returning data in a browser it doesn't appear to be hitting my script...
$.getJSON("http://api.forismatic.com/api/1.0/?method=getQuote&key=457653&format=json&lang=en", function(data) { console.log("OPoop"); });
Rex Smith Jr.
@rsmith731
Dec 29 2016 05:34
does anyone know if it is possible to embed tumblr as the entire page on a website - a client asked me
Josh
@joshfilippi
Dec 29 2016 05:35
@livonian-router does the temperature in my pen appear with lots of numbers after the decimal place? I see a whole number.. ?
DavidMinAZ
@DavidMinAZ
Dec 29 2016 05:35
Incidentally, the console.log() should be console.log(data);
livonian-router
@livonian-router
Dec 29 2016 05:36
@joshfilippi Yeah, it appears with too many numbers here
Josh
@joshfilippi
Dec 29 2016 05:38
ok thanks @livonian-router
CamperBot
@camperbot
Dec 29 2016 05:38
joshfilippi sends brownie points to @livonian-router :sparkles: :thumbsup: :sparkles:
:cookie: 286 | @livonian-router |http://www.freecodecamp.com/livonian-router
James Payne
@jamespayne
Dec 29 2016 05:50
Hey everybody, I just finished Build a Random Route Machine. If anybody has any feedback, that would be great. Here is the pen: http://codepen.io/jlpayne/pen/yVZrLW
  • Quote. Not route!
Josh
@joshfilippi
Dec 29 2016 05:57
@jamespayne It's looks really good. I didn't know about text-shadow css command. Nicely done
James Payne
@jamespayne
Dec 29 2016 06:03
@joshfilippi Thanks a lot! Yeah its pretty handy but I guess you would have to be careful when it comes to browser compatibility. I added an extra user story where you can click on the authors name and it takes you to the wikipedia page for that author. Did you find that feature?
CamperBot
@camperbot
Dec 29 2016 06:03
jamespayne sends brownie points to @joshfilippi :sparkles: :thumbsup: :sparkles:
:cookie: 265 | @joshfilippi |http://www.freecodecamp.com/joshfilippi
RakeshNerkar
@Rakesh18754
Dec 29 2016 06:06
"data": {
    "locationName": "test tag",
    "address": "Bangladesh,Boalkhali",
    "assetTags": [
        {
            "tagType": "du",
            "tagValue": "aadadasd"
        }
    ]
}

var option_cate = '<li class="item"><span>' + malwareLabel +' : ' + dummyJson.data[key] + ' </span></li>';
$(option_cate).appendTo('#malware-menu');

but it gets printed as
locationName : test tag,
address : Bangladesh,Boalkhali,
Asset Tags : [object Object]

The data for assetTags gets printed as object as it is an array of object
How to print the values of the inner array also

James Payne
@jamespayne
Dec 29 2016 06:12
@Rakesh18754 maybe try data.assetTags[0].whateverdatayouneed?
Might be wrong. I've just spent the whole day learning heaps about JSON.
RakeshNerkar
@Rakesh18754
Dec 29 2016 06:13
@jamespayne actully it can contain n number of objects
James Payne
@jamespayne
Dec 29 2016 06:14
maybe a nested loop would help you solve that problem?
DavidMinAZ
@DavidMinAZ
Dec 29 2016 06:16
@jamespayne Looks great... and you used the same API that I have been trying to use without success
James Payne
@jamespayne
Dec 29 2016 06:18
@DavidMinAZ Thanks. Yeah I really struggled to find a solution that worked. It took a fair amount of research to figure it out. Learnt a lot during that process.
CamperBot
@camperbot
Dec 29 2016 06:18
jamespayne sends brownie points to @davidminaz :sparkles: :thumbsup: :sparkles:
:cookie: 265 | @davidminaz |http://www.freecodecamp.com/davidminaz
James Payne
@jamespayne
Dec 29 2016 06:19
@DavidMinAZ Do you have a link to your pen?
DavidMinAZ
@DavidMinAZ
Dec 29 2016 06:20
@jamespayne Yes, though it's far from complete... I'm stuck on trying to figure out how to use the .getJSON() with that API
My pen: http://codepen.io/dmattiuz/pen/zogGeB?editors=0011
@jamespayne I see you used the jsonp option in your call... which I avoided because I didn't know what sort of slippery slope there would be with trying to do something "unvanilla"
Lean Junio
@leanjunio
Dec 29 2016 06:24
@leanjunio
Hey everybody,
Are front-end developers also responsible for making the websites dynamic?
In that sense, introducing a CMS to the site or something along those lines, are those under the web developer's job?
trieucrew
@trieucrew
Dec 29 2016 06:26
Trying to switch between military time and regular time with click and ran into this wall where it keeps switching back and forth when I press the time. Any suggestions?
James Payne
@jamespayne
Dec 29 2016 06:26
@DavidMinAZ Yeah you're probably right. I think the main problem is having to deal with the limitations of codepen and apis together.
DavidMinAZ
@DavidMinAZ
Dec 29 2016 06:29
@jamespayne Does it have something to do with the code being hosted in CodePen as to why I'd need the multi-server-skirting goodness of jsonp?
Saif Ali Khan
@saifat29
Dec 29 2016 06:32
Need help here with the Wikipedia Viewer Project - After searching on the Wikipedia Viewer for the second time, the previous search results doesn't go away. I tried replaceWith(); ,replace(); , show(); , hide(); , but I can't get it right.
DavidMinAZ
@DavidMinAZ
Dec 29 2016 06:32
@jamespayne I just swapped your jsonp url for mine and now mine is returning the query to the console with my test code... WOW
Saif Ali Khan
@saifat29
Dec 29 2016 06:33
Here is my JS code -
$(document).ready(function() {
  $resultsList = $('#resultsList');

  $('#submit').click(function() {
    var query = $("#query").val();

    var url = "https://cors.now.sh/https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=" + query + "&namespace=0&limit=10";
    $.getJSON(url, function(data) {
      //console.log(data);

      for (var i = 0; i < data[1].length; i++) {
        $resultsList.append('<li><div class="card"><div class="card-content"><span class="card-title">'+ data[1][i] +'</span><p>'+ data[2][i] +'</p></div><div class="card-action"><a href="'+ data[3][i] +'" target="_blank">read full article</a></div></div></li>');
      }

    });
  });
});
currently I am using append(); to show the data on the page
James Payne
@jamespayne
Dec 29 2016 06:38
@DavidMinAZ I don't really know the intricacies of it to be honest. That was the only way I found to get around the problem. I'm learning a lot myself and need to do more reading on it because it seems that its a serious security issue. I'll be doing some reading into it. Here is where I started. http://stackoverflow.com/questions/24349907/what-is-difference-between-json-and-jsonp
DavidMinAZ
@DavidMinAZ
Dec 29 2016 06:40
@jamespayne Thanks! Really appreciate that insight and the resource link! Now that I have data coming in I can go back to being frustrated remembering how to get it to show up at my target :laughing:
CamperBot
@camperbot
Dec 29 2016 06:40
davidminaz sends brownie points to @jamespayne :sparkles: :thumbsup: :sparkles:
:cookie: 257 | @jamespayne |http://www.freecodecamp.com/jamespayne
trieucrew
@trieucrew
Dec 29 2016 06:41
can someone help me with the asynchronous problem that I'm having
still confused on how they work
Darth Skywalker
@adityaparab
Dec 29 2016 06:41
@trieucrew shoot
James Payne
@jamespayne
Dec 29 2016 06:42
@DavidMinAZ No worries. Glad I could help. This chat really is a good resource for people to discuss problems and share experiences. Love it.
trieucrew
@trieucrew
Dec 29 2016 06:43
Trying to update time using a boolean variable and setInterval.
Darth Skywalker
@adityaparab
Dec 29 2016 06:43
@trieucrew show your code
Darth Skywalker
@adityaparab
Dec 29 2016 06:44
@trieucrew yes. what is the problem?
trieucrew
@trieucrew
Dec 29 2016 06:47
when i click military is supposed to change to the opposite value.
however it keeps running with what was already declared for military which is true
it as in updatetime
Darth Skywalker
@adityaparab
Dec 29 2016 06:47
@trieucrew what do you mean when i click military ?
trieucrew
@trieucrew
Dec 29 2016 06:48
like the time on the page
the time that is displayed
DavidMinAZ
@DavidMinAZ
Dec 29 2016 06:49
@jamespayne You have no idea how relieved I am to have someone that stumbled along with the solution to my exact issue. I posted in three rooms and didn't get the usual instant response so I went back to looking at it for hours... what a relief!
Darth Skywalker
@adityaparab
Dec 29 2016 06:54
@trieucrew : You will have to do something like this
$(document).ready(function(){
  var int = setInterval(updateTime.bind(this, military),1000,military);
  $("#time").click(function(){
    if(int) {
      clearInterval(int);
      int = setInterval(updateTime.bind(this, military),1000,military);
    }
    military = !military;
  });
});
your military variable was not getting passed as a parameter (format) in your updateTime function.
trieucrew
@trieucrew
Dec 29 2016 06:56
can you explain what bind does
I remember seeing this somewhere
Darth Skywalker
@adityaparab
Dec 29 2016 06:57
additionally, since your military is a global variable, you can also do
function updateTime(){
  var d = new Date(),
      hours = d.getHours(),
      displayHours = military == true ? hours : hours % 12,
      minutes = d.getMinutes() > 9 ? d.getMinutes() : ("0" + d.getMinutes()),
      time = displayHours + ":" + minutes;
  if(hours < 12){
    time += " a.m.";
  }else{
    time += " p.m.";
  }
  $("#time").html(time);
}
$(document).ready(function(){
  $("#time").click(military, function(){
    military = !military;
  });
  setInterval(updateTime,1000);
});
trieucrew
@trieucrew
Dec 29 2016 06:58
oh okay
just wondering is it good technique to keep military as a global or does it not matter
Darth Skywalker
@adityaparab
Dec 29 2016 07:00
@trieucrew keeping things global is generally a bad practice
bind does what bind means.
It will bind scope and parameters to be passed to a function.
but bind will not call the function
when you call the function, whatever is bound to the function using .bind will be reflected in your function.
trieucrew
@trieucrew
Dec 29 2016 07:01
okay i think that helps alot
I've been having trouble with asynchronous function and I think that solves my problem
Darth Skywalker
@adityaparab
Dec 29 2016 07:01
1st argument to bind is the scope (it will be value of this inside your function) and then 2nd arguments onward are parameters to be passed.
:+1:
Hesham Ismail
@uaefame
Dec 29 2016 07:06
Hello, i am trying to build a tribute page for my first html challenge, question? Am i suppose to build one with image, text and URL ? Any other thing to include or these 3 elements
Darth Skywalker
@adityaparab
Dec 29 2016 07:07
@uaefame It's your creation. Do whatever you want.As long as it fulfills all the use cases
Hesham Ismail
@uaefame
Dec 29 2016 07:08
Alright thanks @adityaparab
CamperBot
@camperbot
Dec 29 2016 07:08
uaefame sends brownie points to @adityaparab :sparkles: :thumbsup: :sparkles:
:cookie: 766 | @adityaparab |http://www.freecodecamp.com/adityaparab
trieucrew
@trieucrew
Dec 29 2016 07:09
thanks @adityaparab
CamperBot
@camperbot
Dec 29 2016 07:09
:cookie: 767 | @adityaparab |http://www.freecodecamp.com/adityaparab
trieucrew sends brownie points to @adityaparab :sparkles: :thumbsup: :sparkles:
grantknaver
@grantknaver
Dec 29 2016 07:25
Ok I am stumped can someone help me out
I dont know how to do this
any help would be appreciated
looking on how to accomplish two different AJAX requests
grantknaver
@grantknaver
Dec 29 2016 07:35
any help
Kevin
@KevinBruland
Dec 29 2016 07:36
sure, are you working on a specific project @grantknaver
grantknaver
@grantknaver
Dec 29 2016 07:37
ya @KevinBruland hopefully you can help me
I am working the Twitch problem. Do you think you can help
?
Kevin
@KevinBruland
Dec 29 2016 07:38
sure
want to link what you have?
grantknaver
@grantknaver
Dec 29 2016 07:38
awesome3
Ill post the link right now
Kevin
@KevinBruland
Dec 29 2016 07:38
I have some guesses as to what your problem is, I remember running into issues on that
awesome
Ok here are the problems I am running into
I am trying to post a ajax request for the chanels that are online and the channels that are offline
Kevin
@KevinBruland
Dec 29 2016 07:40
side note real quick, .bind is depreciated
grantknaver
@grantknaver
Dec 29 2016 07:40
the online is not a problem - or at least it does not seem to be
Kevin
@KevinBruland
Dec 29 2016 07:40
so use .on() instead
grantknaver
@grantknaver
Dec 29 2016 07:40
gotcha
thanks
Kevin
@KevinBruland
Dec 29 2016 07:41
let me take a look
what I actually did for this one
was not preform a second API call,
grantknaver
@grantknaver
Dec 29 2016 07:42
I cant figure out what to check for regarding the offline channels. It seems to require a different AJAX request
Kevin
@KevinBruland
Dec 29 2016 07:42
well
grantknaver
@grantknaver
Dec 29 2016 07:42
what did you check for than
Kevin
@KevinBruland
Dec 29 2016 07:43
you see how you have if(response.stream != null) on line 44?
grantknaver
@grantknaver
Dec 29 2016 07:43
yep
Kevin
@KevinBruland
Dec 29 2016 07:43
thats checking to see if they are online, because that will only fire if they are online, right?
grantknaver
@grantknaver
Dec 29 2016 07:43
yep
Kevin
@KevinBruland
Dec 29 2016 07:43
you can just do an else statement after that if
grantknaver
@grantknaver
Dec 29 2016 07:43
if I put an else
I need to get the logo from somewhere and the AJAX request
for something that is null comes back with no logo or url info
which made me think I needed to do a request within a request but that has only caused problems
Kevin
@KevinBruland
Dec 29 2016 07:45
let me look at a call, I used the actual twitch API... so mines a bit different
grantknaver
@grantknaver
Dec 29 2016 07:46
ya now they are saying that is having problems so they recommend changing the url
thanks man I am at my wits end
Kevin
@KevinBruland
Dec 29 2016 07:50
ah, I see now
so in this API, stream is an object that contains the logo
grantknaver
@grantknaver
Dec 29 2016 07:51
yep
but if it comes back null it does not contain the logo
so I used the channel object, but there does not seem to be anthing I can build an if statement around using channel so... hence I am stuck
I have no idea
Kevin
@KevinBruland
Dec 29 2016 07:52
well
the .fail you have on line 102,
grantknaver
@grantknaver
Dec 29 2016 07:53
ya
Kevin
@KevinBruland
Dec 29 2016 07:54
is it failing?
grantknaver
@grantknaver
Dec 29 2016 07:54
nope
everything seems to be working
wait
what are you suggesting
Kevin
@KevinBruland
Dec 29 2016 07:56
sorry, I think I am a bit confused by the layout
grantknaver
@grantknaver
Dec 29 2016 07:56
lol its fine
Kevin
@KevinBruland
Dec 29 2016 07:56
so your get offline is supposed to be a seperate API call, right?
grantknaver
@grantknaver
Dec 29 2016 07:56
yes
I was going to use two diffent api calls to get the info I need
if you have a different idea on how I can generate the info for the different channels, I am open to suggestions
Kevin
@KevinBruland
Dec 29 2016 08:01
where are you calling getOffline?
grantknaver
@grantknaver
Dec 29 2016 08:02
I took it off. it was at the very bottom
it generates a very weird result
I figured the weird result was because I was not inferring what indexes of channels to apply getOffline to
Kevin
@KevinBruland
Dec 29 2016 08:06
I am still looking, I am not really sure if I can help with this format, ive done them very differently
grantknaver
@grantknaver
Dec 29 2016 08:06
what did you do
am I completely off the mark
Kevin
@KevinBruland
Dec 29 2016 08:07
I don't think you are, but I wouldnt do a seperate API call
for offline channels
I didn't have access to logos within the stream call, so I did one call for all channels to /channels/ to get the logo, and then a different call to get the stream info
what I would do is have the offline function just take in one argument for the channel you need to do a separate call on
and then an else after the if(response.stream!=null) that will call that separate API call
if that makes sense
grantknaver
@grantknaver
Dec 29 2016 08:10
hard part is to get to the response.stream you need to be in a request
Kevin
@KevinBruland
Dec 29 2016 08:10
yeah
I had everything inside of the getJSON
grantknaver
@grantknaver
Dec 29 2016 08:12
what do you mean all in everything inside getJSON
Kevin
@KevinBruland
Dec 29 2016 08:13
give me a second and I can make an example
grantknaver
@grantknaver
Dec 29 2016 08:13
thanks
helpful :)
Kevin
@KevinBruland
Dec 29 2016 08:19
here we go
sorry that took so long
so you can see in that example, if data.stream is false, the if statement on line 11 wont fire
so it then goes to the else on line 14, and calls getChannel, passing the channel that did not have data.stream
grantknaver
@grantknaver
Dec 29 2016 08:21
I like ajax alot more
Kevin
@KevinBruland
Dec 29 2016 08:22
the way you did it?
grantknaver
@grantknaver
Dec 29 2016 08:25
no I used getJSON
Kevin
@KevinBruland
Dec 29 2016 08:25
ah, right
grantknaver
@grantknaver
Dec 29 2016 08:25
I like $.ajax more
Kevin
@KevinBruland
Dec 29 2016 08:25
I do too, but you can do simpler getJSON calls as well
Martine Ross
@moi238
Dec 29 2016 08:28
@sziko no problem just glad it worked
Baha Aiman
@bhshkh
Dec 29 2016 08:40
Thanx @sorinr
CamperBot
@camperbot
Dec 29 2016 08:40
bahaaiman sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1013 | @sorinr |http://www.freecodecamp.com/sorinr
Baha Aiman
@bhshkh
Dec 29 2016 08:41
For wikipedia viewer I'm getting the error : "Refused to execute script from 'https://en.wikipedia.org/w/api.php?%20%20%20%20format=json%20%20%20%20&acti…plaintext%20%20%20%20&exsentences=1&exlimit=max&gsrsearch=Albert&callback=?' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled."
Please help
var app = angular.module('wikiApp', []);
app.controller('myCtrl', function ($scope, $http) {
    $scope.searchUrl = `https://en.wikipedia.org/w/api.php?
    format=json
    &action=query
    &generator=search
    &gsrnamespace=0
    &gsrlimit=10
    &prop=pageimages|extracts
    &pilimit=max
    &exintro
    &explaintext
    &exsentences=1&exlimit=max&gsrsearch=Albert&callback=?`;

    $http.jsonp($scope.searchUrl)
        .success(
        function (data) {
            var results = data.query.pages;
            angular.forEach(results, function (v, k) {
                $scope.results.push({ title: v.title, body: v.extract, page: page + v.pageid })
            })

        });



});
Here's the code
Sorin Ruse
@sorinr
Dec 29 2016 08:42
@BahaAiman think you should add into the url that you request a json dataType return. just a sec
Sorin Ruse
@sorinr
Dec 29 2016 08:49
@BahaAiman maybe here format=json you should have &format=json
snehashisc
@snehashisc
Dec 29 2016 09:19
did that work?
the above code looks good to me. Just append '&'
Minoy
@minoy
Dec 29 2016 09:37
Hello everyone!
I am stuck with the 'Counting Cards' Javascript challenge

Following is the code:
var count = 0;

function cc(card) {
// Only change code below this line
switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
count += 1;
break;
case 7:
case 8:
case 9:
count += 0;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
count -= 1;

}

if (count <= 0) {
console.log (count + " Hold");
} else
console.log (count + " Bet");

//return count;
// Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display

cc(2); cc(3); cc(4); cc(5); cc(6);

I am not getting any output. Any ideas?

Ayobami
@purpose50
Dec 29 2016 10:08

Hi guys, i dont know what the problem is here, my s function stream keeps returning undefined when the returned value is defined..
my Code:

$(document).ready(function() {
  var channels = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];

  function stream(channel) {
    var streamResult;
    var stream_link =  "https://wind-bow.gomix.me/twitch-api/streams/" + channel;
    $.getJSON(stream_link, function(result) {
      streamResult = result.stream;
    });

   return streamResult;
  }//end function stream

  alert(stream("ESL_SC2"));

  function channelInfo(stream, channel) {
    //var status = stream(channel);
    if(status === null) {
      var channel_status = "offline";
    }else {
      var channel_status = "online";
    }//end else

    var link = "https://wind-bow.gomix.me/twitch-api/channels/" + channel;
      $.ajax({
      url: link,
      dataType: "jsonp",
      success: function(json) {   
        $(".table").append("<tr><td><img src = '" + json.logo + "' width = '320'></td>");
        $(".table").append("<td>" + json.display_name + "</td>");
        $(".table").append("<td>" + channel_status + "</td></tr>");
      }//end success
    });//end $.ajax
  }//end channelInfo

  for(i = 0; i < channels.length; i++) {
   channelInfo(stream, channels[i]);
  }//end for
});///end document

codepen: http://codepen.io/purpose/pen/dOBxJy

any help please

alpox
@alpox
Dec 29 2016 11:07
@purpose50 $.getJSON is an asynhronous call. That means, that the callback function given to it resolves late, and the code doesn't wait for it with running. so streamResult is not YET set when you return.
You will have to restructure your code accordingly.

When you want to encapsulate that stuff in a function still, you can use something like:

function stream(channel, cb) {
    var streamResult;
    var stream_link =  "https://wind-bow.gomix.me/twitch-api/streams/" + channel;
    $.getJSON(stream_link, function(result) {
      cb(result.stream);
    });
  }

And use it as:

stream("ESL_SC2", function(stream) {
    // here you have the stream
});
Paweł Rokosz
@PawelRokosz
Dec 29 2016 11:11
hey, is it possible to design a html/css/js responsive project in which every section has the height of a device with a 100% fluid width?
alpox
@alpox
Dec 29 2016 11:13
@PawelRokosz Sure
section {
    height: 100vh;
    width: 100%;
}
Paweł Rokosz
@PawelRokosz
Dec 29 2016 11:33
@alpox awesome! Thank you!
CamperBot
@camperbot
Dec 29 2016 11:33
pawelrokosz sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 713 | @alpox |http://www.freecodecamp.com/alpox
marko bogdanovic
@okramovic
Dec 29 2016 11:38
in need of help with wiki challenge. why do i have empty myData?
http://codepen.io/okramovic/pen/woVKXB
Luke Sallmen
@LukeSallmen
Dec 29 2016 12:02
Hey. I'm trying to make my links in my navbar entirely clickable - the whole block, not just the text - but I'm having trouble doing so. Is it possible to turn my text links into "blocks" in the navbar that are entirely clickable?http://codepen.io/LukeSallmen/pen/qqeWoR
Phillip Troutman
@troutman21
Dec 29 2016 12:19
It looks like the whole thing is clickable from my side @LukeSallmen
Sara Soliman
@solimansara
Dec 29 2016 12:20
Good Morning, do i need to include the google font link at the beginning of the page when i am using A Pen?
Phillip Troutman
@troutman21
Dec 29 2016 12:21
only if you want a specific type of font that is not already supported by your bootstrap or something
Sara Soliman
@solimansara
Dec 29 2016 12:24
Are most of the fonts supported by bootstrap?
Phillip Troutman
@troutman21
Dec 29 2016 12:25
I think the basic ones are. Im still very new so i dont have a lot of experience with changing fonts. However I'm going to experiment with some new ones from google just to practice.
@solimansara
Sara Soliman
@solimansara
Dec 29 2016 12:27
Cool, how do you know if the font wanted is supported or not?
Luke Sallmen
@LukeSallmen
Dec 29 2016 12:28
@troutman21 more specifically I want the space above and around the text/anchor to be clickable as well
Icah Banton
@remdata
Dec 29 2016 12:29
need help with the portfolio challenge. Can you use a codePen page as a responsive image?
Luke Sallmen
@LukeSallmen
Dec 29 2016 12:31
@remdata what do you mean?
Icah Banton
@remdata
Dec 29 2016 12:32
@LukeSallmen . I am trying to use a codePen as a thumbnail.
Luke Sallmen
@LukeSallmen
Dec 29 2016 12:33
@remdata oh. you could screenshot it, perhaps?
Icah Banton
@remdata
Dec 29 2016 12:33
@LukeSallmen . where would I store that image?
Luke Sallmen
@LukeSallmen
Dec 29 2016 12:34
@remdata Github is generally recommended, but you could also use tinypic or similar services
Icah Banton
@remdata
Dec 29 2016 12:36
@LukeSallmen . How do you store an image at Github?
Luke Sallmen
@LukeSallmen
Dec 29 2016 12:37
@remdata make a repository and then "upload a file" and then select the images you want to upload.
Icah Banton
@remdata
Dec 29 2016 12:37
thanks Luke. I will try that.
Luke Sallmen
@LukeSallmen
Dec 29 2016 12:45
No problem!
Ayobami
@purpose50
Dec 29 2016 13:07
@alpox yeah thanks
CamperBot
@camperbot
Dec 29 2016 13:07
purpose50 sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 714 | @alpox |http://www.freecodecamp.com/alpox
Ayobami
@purpose50
Dec 29 2016 13:08
Hi guys, i just finished my twitch tv streamer, can you please check it out and tell me what you think?
http://codepen.io/purpose/full/dOBxJy
Ben Line
@Benwebdev
Dec 29 2016 13:13
@purpose50 it's awesome :D.
Ayobami
@purpose50
Dec 29 2016 13:14
@Benwebdev thanks :smile: :+1:
CamperBot
@camperbot
Dec 29 2016 13:14
purpose50 sends brownie points to @benwebdev :sparkles: :thumbsup: :sparkles:
:cookie: 316 | @benwebdev |http://www.freecodecamp.com/benwebdev
Sorin Ruse
@sorinr
Dec 29 2016 13:40
@purpose50 you also need the filters for all, online, offline
Kelechi Chinaka
@ke1echi
Dec 29 2016 13:40
any talk on how i will get started on the random quote machine
Sorin Ruse
@sorinr
Dec 29 2016 13:48
@kelechichinaka a quote is just a quote. so, you have two ways to accomplish this: 1st using an array of quotes and get a random one from the array; 2nd using an quotes api (google for it) that will help you understand how to use apis for the future challanges. as for the layout(html) and design(css) its all up to u
Ayobami
@purpose50
Dec 29 2016 13:57
@sorinr thanks, iwill do that
CamperBot
@camperbot
Dec 29 2016 13:57
purpose50 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1014 | @sorinr |http://www.freecodecamp.com/sorinr
Sorin Ruse
@sorinr
Dec 29 2016 13:58
@purpose50 :+1:
Patrick Tran
@tranpatrick01
Dec 29 2016 14:50
my hr styling is not workinng
help?
Jin
@jin99
Dec 29 2016 15:07
hi guys, any idea how can I make an image bigger in code pen?
Patrick Tran
@tranpatrick01
Dec 29 2016 15:21
anyone know how too use scroll spy?
willstanleyus
@willstanleyus
Dec 29 2016 15:34
API question?
MaxVL
@Makzin
Dec 29 2016 15:59
thanks @TylerMoeller (pretty delayed)
CamperBot
@camperbot
Dec 29 2016 15:59
makzin sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1217 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Tyler Moeller
@TylerMoeller
Dec 29 2016 16:06
@tranpatrick01 Show us your code and maybe we can help with your <hr> and scrollSpy
@jin99 Use CSS to change the size of your image. This might be a good refresher: https://www.freecodecamp.com/challenges/size-your-images
@willstanleyus What's the question?
Santosh Kumar
@santosh
Dec 29 2016 16:08
Guy, where do I upload my video assets? For free? Like I want to use it for video background.
Tyler Moeller
@TylerMoeller
Dec 29 2016 16:10
@santosh Github is one way: https://rawgit.com/, dropbox and Google Drive should also work if you have privacy/security settings set up correctly
pielo2
@pielo2
Dec 29 2016 16:37
HELP! plz got my buttons looking good but do they work NO <div class="container-fluid">
<div class="row">
    <div class="col-md-3">
      <button class="btn btn-block"><a href="https://www.minds.com/Pielo"target="_blank">Minds</a></button>
    </div>
    <div class="col-md-3">
      <button class="btn btn-block"><a href="https://twitter.com/paul_standley"  target="_blank">Twitter</a></button>
    </div>
    <div class="col-md-3">
      <button class="btn btn-block"><a href="https://github.com/"  target="_blank">Github</a></button>
    </div>
    <div class="col-md-3">
      <button class="btn btn-block"><a href="http://www.stumbleupon.com/stumbler/paulstandley1972"  target="_blank">StumbleUpon</a></button></div>
    </div>
  </div>
CamperBot
@camperbot
Dec 29 2016 16:37
no wiki entry for: plz got my buttons looking good but do they work no div classcontainer-fluid div classrow div classcol-md-3 button classbtn btn-blocka hrefhttpswwwmindscompielotarget_blankmindsabutton div div classcol-md-3 button classbtn btn-blocka hrefhttpstwittercompaul_standley target_blanktwitterabutton div div classcol-md-3 button classbtn btn-blocka hrefhttpsgithubcom target_blankgithubabutton div div classcol-md-3 button classbtn btn-blocka hrefhttpwwwstumbleuponcomstumblerpaulstandley1972 target_blankstumbleuponabuttondiv div div
emamadordev
@emamadordev
Dec 29 2016 16:45
@TylerMoeller hey tyler...can you take a look at my simon code? it's still doing the same thing. I implemented the solution that you gave me yesterday. but still the same. can you tell me if you recognize the problem? for now the user has to only input the last color that the ai plays not all the colors.
http://codepen.io/emmanuelamador/full/XNwoxv/
Victor
@VictorHall
Dec 29 2016 16:50
Hi, Can someone help me with the "Smallest Common multiple" intermediate challenge ?
Tyler Moeller
@TylerMoeller
Dec 29 2016 16:51
@pielo2 A <button> element, without any type attribute, is used for submitting a <form>. If you want to style your hyperlinks like buttons, use the btn class with your <a> elements instead.
@VictorHall You'll get better help for that problem at https://gitter.im/FreeCodeCamp/HelpJavaScript
Victor
@VictorHall
Dec 29 2016 16:52
@TylerMoeller okay, i just posted my question in there
Tyler Moeller
@TylerMoeller
Dec 29 2016 16:54

@emamador With this code:

for(var i = 0; i < aiColors.length; i++) {
  playAiColInt(i);
}

You are still calling a function that uses setTimeout(), so the for loop continues to completion before the setTimeout is finished.

Sam Griffen
@ssgriffen
Dec 29 2016 16:57
So...this is the current workaround url to use for the Twitch api? Y/N? https://wind-bow.gomix.me/twitch-api
Tyler Moeller
@TylerMoeller
Dec 29 2016 17:00
@ssgriffen Yes, if you want Free Code Camp's channel info, you would use: https://wind-bow.gomix.me/twitch-api/channels/freecodecamp
Sam Griffen
@ssgriffen
Dec 29 2016 17:00
@TylerMoeller Thanks
CamperBot
@camperbot
Dec 29 2016 17:00
ssgriffen sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1218 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
pielo2
@pielo2
Dec 29 2016 17:01
@TylerMoeller thank you
CamperBot
@camperbot
Dec 29 2016 17:01
pielo2 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1219 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Tyler Moeller
@TylerMoeller
Dec 29 2016 17:01
You're welcome :+1:
Hesham Ismail
@uaefame
Dec 29 2016 17:23
Hello I am trying to build a portfolio for my second html project, question how much I am suppose to edit my portfolio page? it suggest to use codepen to write my codes? can i use an external editor ?
Tom
@moT01
Dec 29 2016 17:24
@uaefame they want a link to the codepen i believe, ...i use an external editor then paste it to codepen when im done
Hesham Ismail
@uaefame
Dec 29 2016 17:25
Thanks @moT01 , after posting the link are they going to look at it ? or is it done ?
CamperBot
@camperbot
Dec 29 2016 17:25
uaefame sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 443 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
Dec 29 2016 17:26
its done, i would guess that if anyone ever looks at it, it would be when you get the certification
im sure you can still edit it if you want
Hesham Ismail
@uaefame
Dec 29 2016 17:27
@moT01 Thanks again
CamperBot
@camperbot
Dec 29 2016 17:27
:warning: uaefame already gave mot01 points
uaefame sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
Tom
@moT01
Dec 29 2016 17:27
yup, good luck
Merryl
@MerrylArok
Dec 29 2016 17:42
Can someone help me understand why my topnav still has margin on top and left?
http://codepen.io/Merryl/pen/LbwQNp/
Tom
@moT01
Dec 29 2016 17:47
body has a default margin
c0d0er2
@c0d0er2
Dec 29 2016 18:08
Can somebosy please help me with getting my images apart? https://codepen.io/c0d0er2/pen/oYrppg
Tyler Moeller
@TylerMoeller
Dec 29 2016 18:17
@c0d0er2 Add the img-responsive class to your images - or use CSS and use max-width: 100%
c0d0er2
@c0d0er2
Dec 29 2016 18:19
@TylerMoeller Thanks!
CamperBot
@camperbot
Dec 29 2016 18:19
c0d0er2 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1222 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Sorin Ruse
@sorinr
Dec 29 2016 18:39
@c0d0er2 here some idea for your problem example
Ashwini Sridhar
@Ash1108
Dec 29 2016 18:47
Hello. I have got a problem . My code isn't accepting 100% width. Can anyone see to it and help me to find out the mistake?
Ankit Agarwal
@ankit-prgmr
Dec 29 2016 18:48
@Ash1108 can you post your code link?
My problem is my 2nd image isn't taking 100% .
Ankit Agarwal
@ankit-prgmr
Dec 29 2016 18:56
@Ash1108 Change this line <div> <!--award images ends here--> to this
</div> <!--award images ends here-->
@Ash1108 You were not closing that div
Ashwini Sridhar
@Ash1108
Dec 29 2016 18:59
Oh thankyou @ankit-prgmr Such a silly mistake, i was analyzing it for half an hour. Thanks!
CamperBot
@camperbot
Dec 29 2016 18:59
ash1108 sends brownie points to @ankit-prgmr :sparkles: :thumbsup: :sparkles:
:cookie: 255 | @ankit-prgmr |http://www.freecodecamp.com/ankit-prgmr
Ankit Agarwal
@ankit-prgmr
Dec 29 2016 18:59
@Ash1108 No worries
Skyelar Habberfield
@habberfields
Dec 29 2016 19:45
Hey everyone! Just a random question... any recommended image hosting sites? tried using my flickr but the file for my logo comes through low res
Ankit Agarwal
@ankit-prgmr
Dec 29 2016 19:46
@habberfields you can use cloudinary or this https://imgsafe.org/
dilip chavan
@dilipchavan561
Dec 29 2016 20:37
how to give link of codepen after completing tribute page??
i guess bo luck here,
no luck
dilip chavan
@dilipchavan561
Dec 29 2016 20:48
????
Ritvars
@RitvarsZ
Dec 29 2016 20:56
@dilipchavan561 Go in your codepen, and just copy the url, then go on fcc and submit it ✌
Igor Amidzic
@igoramidzic
Dec 29 2016 21:11
Can someone help me with a problem?
I have a web app which has a '/', '/account', and '/account/info'.
Everything works in '/' and '/account', but if I go to '/account/', I get this:
Capture.PNG
using node js & express
c0d0er2
@c0d0er2
Dec 29 2016 21:18

Can anybody please help me on Use Bracket Notation to Find the First Character in a String in JavaScript? Here is my code:

var firstLetterOfFirstName = "";
var firstName = "Ada";
firstLetterOfFirstName = firstName[0];

// Setup
var firstLetterOfLastName = "";
var lastName = "Lovelace";

// Only change code below this line
var firstLetterOfLastName = "";
var lastName = "Frank";
firstLetteOfFirstName = firstName[0];

Here is my link: https://www.freecodecamp.com/challenges/use-bracket-notation-to-find-the-first-character-in-a-string

Igor Amidzic
@igoramidzic
Dec 29 2016 21:27
@c0d0er2 Read the instructions. It says the firstLetterOfFirstName variable should be = 'L'
@c0d0er2 So, you should set firstLetterOfFirstName = lastName[0],
since the last name starts with L.
Your first name starts with A
c0d0er2
@c0d0er2
Dec 29 2016 21:28
@igoramidzic Ok, Thanks!
CamperBot
@camperbot
Dec 29 2016 21:28
:warning: could not find receiver for igoramidzic
c0d0er2 sends brownie points to @igoramidzic :sparkles: :thumbsup: :sparkles:
Igor Amidzic
@igoramidzic
Dec 29 2016 21:28
@c0d0er2 Any time
Tyler Moeller
@TylerMoeller
Dec 29 2016 21:33
@igoramidzic Those errors mean that the files don't exist in those locations. If the files are indeed there, we'd have to see all your code to help further.
Igor Amidzic
@igoramidzic
Dec 29 2016 21:34
@TylerMoeller Well no, they're not there.
My images folder, for example, is in 'localhost:3000/img',
@TylerMoeller but if I go to 'localhost:3000/account/', it tries to look for img folder in 'localhost:3000/account/img'
Tyler Moeller
@TylerMoeller
Dec 29 2016 21:35
@igoramidzic Are you using relative paths instead of absolute paths to those files perhaps?
Igor Amidzic
@igoramidzic
Dec 29 2016 21:35
@TylerMoeller yes
how do I set absolute path?
Tyler Moeller
@TylerMoeller
Dec 29 2016 21:36
The absolute path would be http://localhost:3000/img/...
instead of ./img/...
Igor Amidzic
@igoramidzic
Dec 29 2016 21:37
@TylerMoeller What happens when I want to deploy this for production? Tough luck for me? Gotta change every link again to http://website.com/img/?
Tyler Moeller
@TylerMoeller
Dec 29 2016 21:38
Ideally, a variable can be used in place of http://localhost:3000/ so your code can move from one server to another
Igor Amidzic
@igoramidzic
Dec 29 2016 21:38
oh I see
so I could do handlebars img src="{{ absolutePath }}/img"
Tyler Moeller
@TylerMoeller
Dec 29 2016 21:39
I forget how to do that in node offhand, but it should be able to query something like http_host:server_port
Igor Amidzic
@igoramidzic
Dec 29 2016 21:39
Oh, alright
@TylerMoeller Thank you
CamperBot
@camperbot
Dec 29 2016 21:39
igoramidzic sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1224 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Tyler Moeller
@TylerMoeller
Dec 29 2016 21:39
hope that helps get you on the right path :+1:
Igor Amidzic
@igoramidzic
Dec 29 2016 21:39
lol
Tyler Moeller
@TylerMoeller
Dec 29 2016 21:39
no pun intended :)
Igor Amidzic
@igoramidzic
Dec 29 2016 21:40
no pun taken :shipit:
Tyler Moeller
@TylerMoeller
Dec 29 2016 21:40
lol
Colin
@finkbeca
Dec 29 2016 21:47
hi im new
Igor Amidzic
@igoramidzic
Dec 29 2016 21:48
@finkbeca type "hello world!"
Luuk Motz
@mumBa1
Dec 29 2016 21:49
hello guys, i litterly forgot how to center text in css. could someone help me?
Igor Amidzic
@igoramidzic
Dec 29 2016 21:49
@mumBa1 text-align: center
Luuk Motz
@mumBa1
Dec 29 2016 21:49
thanks
Igor Amidzic
@igoramidzic
Dec 29 2016 21:49
np
Luuk Motz
@mumBa1
Dec 29 2016 21:50
i did it with double l :)
Igor Amidzic
@igoramidzic
Dec 29 2016 21:50
lmao
Colin
@finkbeca
Dec 29 2016 21:50
I have a question, how can I draw a diagnol line from the top center of a div to the bottom right.
Luuk Motz
@mumBa1
Dec 29 2016 21:52
i really dont know
Igor Amidzic
@igoramidzic
Dec 29 2016 21:52
@finkbeca
---------------------------------------------------|
| \ |
| \ |
| \ |
|____|
oops that didn't work lol
Colin
@finkbeca
Dec 29 2016 21:53
@igoramidzic haha
Igor Amidzic
@igoramidzic
Dec 29 2016 21:53
/*
---------------------------------------------------|
|                                       \                                     |
|                                                \                            |
|                                                            \                |
|____________________________\__|
*/
fuk
Luuk Motz
@mumBa1
Dec 29 2016 21:53
legend
Colin
@finkbeca
Dec 29 2016 21:54
is their a way to make like a clean diagnol and not use the backslash lol
Luuk Motz
@mumBa1
Dec 29 2016 21:54
get a permanent marker and a ruler
just look it up on intrnet
where do you need it for?
Luuk Motz
@mumBa1
Dec 29 2016 22:04
how do i center a picture then?
rusdie
@rusdie
Dec 29 2016 22:05
im stuck
at portfolio
:cry:
Luuk Motz
@mumBa1
Dec 29 2016 22:06
whats the matter
rusdie
@rusdie
Dec 29 2016 22:06
i just got no idea
can you give me example of your portfolio ?
Luuk Motz
@mumBa1
Dec 29 2016 22:06
currently im doing the tribute page
rusdie
@rusdie
Dec 29 2016 22:07
ah
after tribut you will get portfolio
Luuk Motz
@mumBa1
Dec 29 2016 22:07
but just tell aboout where you live how old you are
abou*
about*
CamperBot
@camperbot
Dec 29 2016 22:07
you need to ask about @someone!
rusdie
@rusdie
Dec 29 2016 22:07
21
Tyler Moeller
@TylerMoeller
Dec 29 2016 22:08
@finkbeca put a div inside another div, add a border, and then use transform: rotate(45deg);. You'll have to adjust the position to line it up correctly though. Another way is with SVG:
<div class="div-with-diagonal-line">
  <svg width="100" height="100">
    <path d="M 0 0 L 100 100" stroke="red" stroke-width="2" fill="none" />
  </svg>
</div>
.div-with-diagonal-line {
  background-color: #eee;
  width: 100px;
  height: 100px;
}
Jinnd319
@Jinnd319
Dec 29 2016 22:10
Meme's aside, why are the elements in my navbar stacking? http://codepen.io/jinnd319/pen/ENJPxq
Tyler Moeller
@TylerMoeller
Dec 29 2016 22:11
@Jinnd319 Small spelling error on line 14: <ul clas="nav navbar-nav">
Colin
@finkbeca
Dec 29 2016 22:12
@tyler moeller thanks
CamperBot
@camperbot
Dec 29 2016 22:12
:cookie: 29 | @tyler |http://www.freecodecamp.com/tyler
finkbeca sends brownie points to @tyler :sparkles: :thumbsup: :sparkles:
Jinnd319
@Jinnd319
Dec 29 2016 22:12
@TylerMoeller life saving find. is there a method to catch these errors or do I just have to rely on not being blind?
Tyler Moeller
@TylerMoeller
Dec 29 2016 22:13
@Jinnd319 In codepen, there's a down error in the top, right-hand corner of the HTML, CSS, and JS panels. Click that and analyze your code - it will tell you about errors like this.
Jinnd319
@Jinnd319
Dec 29 2016 22:15
@TylerMoeller Thank you!
CamperBot
@camperbot
Dec 29 2016 22:15
jinnd319 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1225 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Tyler Moeller
@TylerMoeller
Dec 29 2016 22:16
No problem :+1:
ADIL KARMOUZI
@mradil16
Dec 29 2016 22:27
Hi everyone . should I learn , node js or PHP ? (my goal is to build wordpress themes )
larrygold
@larrygold
Dec 29 2016 22:29
Hey ! Hope you are all well :) On Codepen I can't animate my title with a JS "animated bounce" class. Nothing happens

Here is my JS:

$(document).ready(function() {
$(".text-primary").addClass("animated bounce");
});

And HTML:

<h1 class="text-primary">Jean-Christophe Victor</h1>

MC00T
@MC00T
Dec 29 2016 22:33
Hi, I'm wondering if my tribute webpage is good enough to move on to the next challenge... https://codepen.io/MC00T/full/zKQykP/
larrygold
@larrygold
Dec 29 2016 22:35
@MC00T : Looks good, I think you could add two columns (like "left-well" and "right-well"), unordered lists, text in bold, buttons and that would be perfect !
MC00T
@MC00T
Dec 29 2016 22:37
@larrygold thank you very much for ur feedback!
CamperBot
@camperbot
Dec 29 2016 22:37
mc00t sends brownie points to @larrygold :sparkles: :thumbsup: :sparkles:
:cookie: 119 | @larrygold |http://www.freecodecamp.com/larrygold
brycemcdonald86
@brycemcdonald86
Dec 29 2016 22:41
On the wikipedia project, I'm trying to execute the api when something is typed in the search bar, but whenever it runs that part, it reloads the page immediately. http://codepen.io/brycemcdonald86/pen/amObAL
Andrew Thompson
@zovaaa
Dec 29 2016 22:48
AFAIK the form onsubmit event should return 'false' to stop the reloading behavoiur
brycemcdonald86
@brycemcdonald86
Dec 29 2016 22:59
@zovaaa Thanks! that worked
CamperBot
@camperbot
Dec 29 2016 22:59
brycemcdonald86 sends brownie points to @zovaaa :sparkles: :thumbsup: :sparkles:
:cookie: 115 | @zovaaa |http://www.freecodecamp.com/zovaaa
Tyler Moeller
@TylerMoeller
Dec 29 2016 23:00
@brycemcdonald86 use event.preventDefault() right above your search() call.
You don't have to check for keyCode 13 by the way. Here's a basic example of searching on Enter to give an idea: http://s.codepen.io/TylerMoeller/pen/woyXRz
brycemcdonald86
@brycemcdonald86
Dec 29 2016 23:22
@TylerMoeller Thanks! that is very good to know. I assumed there must be a way, but was too lazy to find it haha
CamperBot
@camperbot
Dec 29 2016 23:22
brycemcdonald86 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1226 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Spyrantis Theodoros
@thodorisanta
Dec 29 2016 23:37
Me and my girlfriend just.split(). Can i use .join() again? Or should i .push() another girl to my class?
Simon Cordova
@gbsimon87
Dec 29 2016 23:40
Hey guys, good evening to all!
Was wondering if anyone can take a quick 30 second glimpse to an API's documentation and possibly spot where I'm going incorrect?
My API key has been approved, and when I insert it using the endpoint it is successful.
However, whenever I try to add parameters, it says invalid.
I assume it's something wrong with the way I'm writing the parameters but can't fiure it out...