These are chat archives for FreeCodeCamp/HelpFrontEnd

21st
Aug 2016
buiphuking
@buiphuking
Aug 21 2016 01:17
twitchScreen.PNG
plz tell me what do you think about the colors ???????????????????/
Micah Points
@msp327
Aug 21 2016 01:21
I think I accomplished the needed user stories, but am looking for suggestions to improve/enhance the Tribute Page. https://codepen.io/msp327/pen/grXEGq
Norvin Burrus
@ndburrus
Aug 21 2016 01:34
@MariSimmons this may be useful: :sparkles:
buiphuking
@buiphuking
Aug 21 2016 02:11
plz someone help me with css
Dylan
@dhcodes
Aug 21 2016 02:20
@msp327 the first image is taller than the other two and on mobile, is smaller
idk if that is a class issue or what?
Micah Points
@msp327
Aug 21 2016 02:25
@dhcodes The first image is a slightly different size and since I had to pull them from the internet. I don't have asset hosting on Codepen. I tried to center them as best as I could to offset for the size difference.
Dylan
@dhcodes
Aug 21 2016 02:26
@msp327 what about adding the img-responsive class to each
?
Kevin Murphy
@kaym0
Aug 21 2016 02:27
Hey cana nybody help me with some Angular
Dylan
@dhcodes
Aug 21 2016 02:28
@kaym0 you're probably better off in the main room
Jose Escobar Mejia
@mejiaadonay
Aug 21 2016 02:29
Hello guys, I am doing the "Build a Tribute Page" but my question is, do I need to build the same example page or I can build any?
Gary Siu
@GarySiu
Aug 21 2016 02:29
@mejiaadonay You're meant to build your own one
Jose Escobar Mejia
@mejiaadonay
Aug 21 2016 02:30
Ok thanks @GarySiu
CamperBot
@camperbot
Aug 21 2016 02:30
:cookie: 206 | @garysiu |http://www.freecodecamp.com/garysiu
mejiaadonay sends brownie points to @garysiu :sparkles: :thumbsup: :sparkles:
Micah Points
@msp327
Aug 21 2016 02:32
@dhcodes They have that class on them already. I fixed their size and that seems to work for the mobile view, but it isn't working for the larger screen. https://codepen.io/msp327/pen/grXEGq
Dylan
@dhcodes
Aug 21 2016 02:38
@msp327 you can change this line in your .img-responsive class in the css height: 400px !important;
in other words add !important
and it will make them all uniform
doesn't have to be 400px
Micah Points
@msp327
Aug 21 2016 02:40
@dhcodes That's it. This wouldn't be an issue if I resized all the images. Thanks a lot for your help!
CamperBot
@camperbot
Aug 21 2016 02:40
msp327 sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1343 | @dhcodes |http://www.freecodecamp.com/dhcodes
Dylan
@dhcodes
Aug 21 2016 02:41
np
looked good as is, just figured you were going for a uniform look
Micah Points
@msp327
Aug 21 2016 02:43
@dhcodes It definitely looks more put together with uniform images.
Steven Foster
@Rockchalk8985
Aug 21 2016 03:26
Need some help not sure why I'm can't get my image in a circle. Help please.
DJ
@qualitymanifest
Aug 21 2016 03:30
@Rockchalk8985 you're not giving the URL on your img tag closing quotation marks so it's treating the rest of the img tag like it's in quotation marks
Sorin Ruse
@sorinr
Aug 21 2016 03:31
@msp327 i would put the three photos in a carousel
Lauren Conners
@laurenconners
Aug 21 2016 03:35
I need to get started on my portfolio, but I'm a little lost as where to start. I get overwhelmed at all the design options.
Trying to find examples online that I like the visual structure of so i can decide and try to recreate something similar.
Mark
@mlawson3691
Aug 21 2016 03:36

function addTogether(num1, num2) {
  for (i = 0; i < arguments.length; i++) {
    if (typeof arguments[i] !== 'number') {
      return undefined;
    }
  }
  if (arguments.length > 1) {
    return num1 + num2;
  } else {
    var prev = arguments[0];
    return function(num) {
      return prev + num;
    };
  }
}

addTogether(2,[3]);
I am working on the "Arguments Optional" algorithm and I can't get the last test to pass (where parameters are (2, [3]). I've run it in jsFiddle and it seems to work as expected. Anyone have any ideas? Is this a bug?
function should return undefined because [3] is not a number...
Lauren Conners
@laurenconners
Aug 21 2016 03:38
I haven't gotten to the algorithms. Why is 3 inside brackets?
Mark
@mlawson3691
Aug 21 2016 03:38
its an array
with the single item 3
Lauren Conners
@laurenconners
Aug 21 2016 03:38
Should the array be assigned to a variable, and then it be (2, x)? Would that work?
Or rather, could, not should.
Might be a workaround if codepen the challenge is being buggy for some reaosn.
Mark
@mlawson3691
Aug 21 2016 03:40
for the algorithms, you run your code and FCC has preset tests that it runs to make sure your code works, the array is one of their preset tests
so i can't change that :(
Sorin Ruse
@sorinr
Aug 21 2016 03:40
@Rockchalk8985 first i would add this to css: a{ color: #ffffff !important; } to make the text on buttons more visible
Lauren Conners
@laurenconners
Aug 21 2016 03:41
Darn.
DJ
@qualitymanifest
Aug 21 2016 03:43
@mlawson3691 you're almost there
@mlawson3691 in the function you return you also need to check to see if the argument it gets is a number or not, and then either do math or return undefined accordingly
you won't need a loop since it's only supposed to take one argument
Mark
@mlawson3691
Aug 21 2016 03:44
i don't follow. the second half is where it does the math
the loop first checks to make sure inputs are numbers. if so, it drops to the bottom where it either does the math (with two numbers) or returns a function (with one number)
DJ
@qualitymanifest
Aug 21 2016 03:45
@mlawson3691 i'm talking about the anonymous function here
return function(num) {
      return prev + num;
  };
you need to check the argument that that function receives
If either argument isn't a valid number, return undefined.
Mark
@mlawson3691
Aug 21 2016 03:46
right, the loop takes care of that, no?
DJ
@qualitymanifest
Aug 21 2016 03:47
@mlawson3691 no, since the loop can't see the argument that that function gets
Mark
@mlawson3691
Aug 21 2016 03:49
ohhhhhh...
i was reading "addTogether(2)(3)" as "addTogether(2,3)"
the 3's there are supposed to be in []
thank you for helping me see that @qualitymanifest
CamperBot
@camperbot
Aug 21 2016 03:50
mlawson3691 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star2: 1364 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
Aug 21 2016 03:50
np
Mark
@mlawson3691
Aug 21 2016 03:51
have a good night! :)
Tiffany White
@twhite96
Aug 21 2016 03:51
Can someone help with this Random Quote Generator? I can't seem to figure out why [Object object] is being entered into the tweet box. Here is my CodePen: http://codepen.io/twhite96/pen/XKqrJX
Taylor
@admiraltaylor
Aug 21 2016 03:51
@twhite96 that means that whatever you code is calling is coming back as an array rather than the object you're looking for
so instead of coming back as "quote" it's ["quote]
er
["quote"]
Tiffany White
@twhite96
Aug 21 2016 03:52
Oh. Okay. Hmmm. I fixed that in a previous iteration
But I wanted to add more features and have forgotten how I fixed it.
DJ
@qualitymanifest
Aug 21 2016 03:52
@twhite96 quotebox is an html element
Taylor
@admiraltaylor
Aug 21 2016 03:52
but since it says "object object" that probably means it's returning [something:"something"]
Tiffany White
@twhite96
Aug 21 2016 03:53
Okay @qualitymanifest
DJ
@qualitymanifest
Aug 21 2016 03:53
@twhite96 you only want the text from that html element
Tiffany White
@twhite96
Aug 21 2016 03:53
Let me take a look
So I would use text() right @qualitymanifest
DJ
@qualitymanifest
Aug 21 2016 03:53
yep
Taylor
@admiraltaylor
Aug 21 2016 03:54
So I have a formatting question I could use help with. I'm trying to add an image and some text to a jumbotron element, but the image is loading too low and partially outside the jumbotron.
does anyone know how to change the formatting?
here's my link
...pretty please?
Lauren Conners
@laurenconners
Aug 21 2016 03:57
Are you missing a value for padding-bottom?
for class el
and en ending ;
Tiffany White
@twhite96
Aug 21 2016 03:58
@qualitymanifest not sure where to put it. I've tried to use text() instead of html in the places that make the most sense. But it still results in an array
Taylor
@admiraltaylor
Aug 21 2016 03:59
I'll give that a try. Putting a padding on the image itself seems to change the shape, oddly @laurenconners
DJ
@qualitymanifest
Aug 21 2016 03:59
@twhite96 you only need it on line 36 where you are concatenating quotebox into the URL
quotebox.text()
Taylor
@admiraltaylor
Aug 21 2016 04:00
@laurenconners no dice; the image still seems to be starting at the same level as the text, rather than being centered within the jumbotron
Lauren Conners
@laurenconners
Aug 21 2016 04:01
hrmmmm
Tiffany White
@twhite96
Aug 21 2016 04:01
Got it, @qualitymanifest. Thank you.
CamperBot
@camperbot
Aug 21 2016 04:01
twhite96 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star2: 1365 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
Taylor
@admiraltaylor
Aug 21 2016 04:03
Got it: I gave it a negative margin-top
Lauren Conners
@laurenconners
Aug 21 2016 04:04
I was just about to suggest that. I forked it off to test that.
Good luck with the rest! I just got to the portfolio project, though I might put that off until after the js training so I can get even more fancy and actually have things to put IN the portfolio.
ashnel
@ashnel
Aug 21 2016 05:34
Would anyone be willing to help me with the weather app project by mentoring through it? Despite all the reading I've been doing I'm really struggling to understand APIs and would greatly appreciate the assistance.
Sorin Ruse
@sorinr
Aug 21 2016 05:52
@ashnel first decide how would you like to get the user location: you can use an ip location api like: http://ip-api.com/json .this is returning a json object from where you get the coordinates (latitude, longitude, city, country, ecc). To use that api in your js part of the codepen you will have to write a function like $.getJSON(' http://ip-api.com/json', function(json){here you grab the returned data and do whatever with it}); then call an weather api using the coordinates from the previous api call
ashnel
@ashnel
Aug 21 2016 06:11
@sorinr I know the steps to put it together, I've just been struggling all night to actually take the action to put it together =S
DJ
@qualitymanifest
Aug 21 2016 06:12
This message was deleted
Sorin Ruse
@sorinr
Aug 21 2016 06:14
@ashnel what you don't know and need help for?
himanhsu
@Himanshu54
Aug 21 2016 06:19
This message was deleted

why is image not able to open link??

<div class="social" id="facebook"><a herf="https://www.facebook.com/erickeagle54" target="_blank"><img src="http://www.iconsdb.com/icons/preview/icon-sets/ice/facebook-3-xxl.png"></a></div>

Jaren Escueta
@jarenescueta731
Aug 21 2016 07:29
@Himanshu54 href, not herf
江煜章
@angusjonior
Aug 21 2016 08:45

@angusjonior
208 Counting Cards How to add the count and“Hold”“Bet”?
var count = 0;

function cc(card) {
// Only change code below this line
if(card<=6&&card>=2){
count = count + 1;
}else if(card==10||card=='J'||card=='Q'||card=='K'||card=='A'){
count = count - 1;
}

return count;
// Only change code above this line
}
cc(2); cc(3); cc(7); cc('K'); cc('A');

Milos
@Milos2709
Aug 21 2016 10:01
Finally, here's my Local Weather app. What do you guys think? :)
http://codepen.io/Milos2709/full/WxmdaA/
Sorin Ruse
@sorinr
Aug 21 2016 10:44
@Milos2709 why do you have that button with "not seeing info" ? as you first get the temp in C the convert to C btn should be disabled. when you click on convert to F disable this one and enable convert to C
Milos
@Milos2709
Aug 21 2016 10:46
Thanks @sorinr
The button is because it usually does not work in http.
CamperBot
@camperbot
Aug 21 2016 10:46
:cookie: 674 | @sorinr |http://www.freecodecamp.com/sorinr
milos2709 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
Sorin Ruse
@sorinr
Aug 21 2016 10:48
@Milos2709 yes. looking at the code i saw you where using navigator that require https connection.
Dmytro
@lomm28
Aug 21 2016 11:11
Hi there! I am working on weather app and I have few issues with it. First, it does not work in google chrome(I have 52.0 version). Second, it does not show exact location (it shows a town nearby not the city I live in)...
http://codepen.io/lomm28/full/grkXEy/
Any ideas?
Sorin Ruse
@sorinr
Aug 21 2016 11:19
@lomm28 first run your pen over https not http coz geolocation does not work on http and second prepend your var api with https://crossorigin.me/ and it will work
Dmytro
@lomm28
Aug 21 2016 11:28
@sorinr I will try crossorigin.me, but it does not work even when I run it over https
Sorin Ruse
@sorinr
Aug 21 2016 11:33
@lomm28 you should use both. add crossorigin.me and run the pen over https
KAIKAUS(PANZER BATTALION)
@AALA-HUSSA1N
Aug 21 2016 11:37
i'm here on this challenge
Basic Front End Development Projects
build a tribute page and they give this link
https://codepen.io/FreeCodeCamp/full/NNvBQW/
do i have to make a static page like this?with my own story or whatever i want to add the content?right
Dmytro
@lomm28
Aug 21 2016 11:47
@sorinr: thank you...I will try that!
CamperBot
@camperbot
Aug 21 2016 11:47
lomm28 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 675 | @sorinr |http://www.freecodecamp.com/sorinr
PalashGore
@PalashGore
Aug 21 2016 12:22
How am I supposed to submit the code from pen?
George Miller
@GMiller64
Aug 21 2016 12:34
@AALA-HUSSA1N Yes, just a static page similar to the example provided. You can feature whatever or whom ever you want.
Markus Hald Juul-Nyholm
@MarkusHald
Aug 21 2016 12:43
Hi guys. Im currently making a portfolio page in codepen, but when i scroll down the page my navbar (fixed navbar that stays in the top of the screen when you scroll down) goes behind the different pictures on my page. I was wondering if any of you would take a look at my code and help me? :grinning: http://codepen.io/MarkusHald/pen/dXAOmP
Sorin Ruse
@sorinr
Aug 21 2016 12:48
@MarkusHald add z-index:1 to your nav
Markus Hald Juul-Nyholm
@MarkusHald
Aug 21 2016 12:51
@sorinr Thanks a lot man! :D Now i would love to give you some brownie points but im not sure how :S
CamperBot
@camperbot
Aug 21 2016 12:51
:cookie: 676 | @sorinr |http://www.freecodecamp.com/sorinr
markushald sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
Markus Hald Juul-Nyholm
@MarkusHald
Aug 21 2016 12:52
oh haha :D
dannylom
@dannylom
Aug 21 2016 13:23
Hi all, I am having some trouble with css I have the below css and I'm trying to have a different background color on the left and right of the block.
display: block;
background-color: #d1d1d1;
width: 1000px;
margin-top: auto;
margin-left: auto;
margin-right: auto;
John Alcher
@alchermd
Aug 21 2016 13:31
Can anyone guide my hand on the Simon Game project? I've been stuck for a week now :/
Shailza
@shailza
Aug 21 2016 14:19
can anyone guide me with Building a random quote machine
Gaurav Tolani
@Gauravtolani
Aug 21 2016 14:21
@shailza ... have you done the frond end part?
front*
the bootstrap part..
Shailza
@shailza
Aug 21 2016 14:30
@Gauravtolani i am on it
Gaurav Tolani
@Gauravtolani
Aug 21 2016 14:34
when you are done.. read about the .text() , .html() and some basic methods in jquery..then have some knowledge about math.random() and math.floor() functions..
@shailza
you just need some basic understanding of jquery functions for random quote machine.. and instead of using an api... try just making a json array of objects by yourself and fetch date from it.. it will be easy.. and post your queries here.. whenever you are stuck.. @shailza
Shailza
@shailza
Aug 21 2016 15:00
@Gauravtolani yes thankyou
CamperBot
@camperbot
Aug 21 2016 15:00
shailza sends brownie points to @gauravtolani :sparkles: :thumbsup: :sparkles:
:cookie: 271 | @gauravtolani |http://www.freecodecamp.com/gauravtolani
Sorin Ruse
@sorinr
Aug 21 2016 15:20
@dannylom you can try to use linear gradient for the background. something like: background: linear-gradient(to right, #ffffff 0%,#ffffff 49%,#207cca 50%,#207cca 50%,#207cca 100%,#207cca 100%);
Shailza
@shailza
Aug 21 2016 15:39
@Gauravtolani m done with html css part
Lauren Conners
@laurenconners
Aug 21 2016 15:51
Anyone here work with w3schools.com as well? If so, do you find it helpful in addition to FCC?
Adam Jacks
@AdamHJ123
Aug 21 2016 15:52
Guys, can I get some opinions on this please: http://s.codepen.io/AdamHJacks/debug/NAmkzr
Just the loading screen and so on
ashish singh
@ashish1729
Aug 21 2016 15:52
@AdamHJ123 looks good
Adam Jacks
@AdamHJ123
Aug 21 2016 15:52
@ashish1729 Thanks!
CamperBot
@camperbot
Aug 21 2016 15:52
adamhj123 sends brownie points to @ashish1729 :sparkles: :thumbsup: :sparkles:
:cookie: 374 | @ashish1729 |http://www.freecodecamp.com/ashish1729
ashish singh
@ashish1729
Aug 21 2016 15:54
@AdamHJ123 can you share link to pen
i want to see the code
Adam Jacks
@AdamHJ123
Aug 21 2016 15:55
Sure
ashish singh
@ashish1729
Aug 21 2016 15:56
thanks
Adam Jacks
@AdamHJ123
Aug 21 2016 15:56
I'm remaking my portfolio, I think it should work well
Lauren Conners
@laurenconners
Aug 21 2016 15:56
@AdamHJ123 I love the loading screen.
Adam Jacks
@AdamHJ123
Aug 21 2016 15:57
@laurenconners Thanks :D
CamperBot
@camperbot
Aug 21 2016 15:57
adamhj123 sends brownie points to @laurenconners :sparkles: :thumbsup: :sparkles:
:cookie: 122 | @laurenconners |http://www.freecodecamp.com/laurenconners
Lauren Conners
@laurenconners
Aug 21 2016 15:57
@ashish1729 How did you do the scroll thing with the images? So that they scroll up and over the previous
ashish singh
@ashish1729
Aug 21 2016 16:00
@laurenconners sorry i dont understand your problem
Lauren Conners
@laurenconners
Aug 21 2016 16:01
On your portfolio. As your scroll down, the background images come up and over the previous background image. The image scrolls into view, then becomes static as the next image comes into view. Does that make sense?
ashish singh
@ashish1729
Aug 21 2016 16:02
ok let me check my portfolio :P
can you send link if you have it open
Lauren Conners
@laurenconners
Aug 21 2016 16:02
I guess just one image does that, actually. But it looks fantastic.
It's like a scrolling transparency over some images? As you scroll it doesn't necessarily move the image itself, but shows a higher portion of it.
ashish singh
@ashish1729
Aug 21 2016 16:03
give me a sec
its too old .. i have an idea .. but i will confirm in just a minute
Lauren Conners
@laurenconners
Aug 21 2016 16:04
cool, thanks
brb
i have used background attachment fixed actually
i hope you can see my code ?
Sorin Ruse
@sorinr
Aug 21 2016 16:09
@laurenconners you mean lazy loading of images?
ashish singh
@ashish1729
Aug 21 2016 16:09
@laurenconners just remove that background attachment thing from css .. and you will see
Lauren Conners
@laurenconners
Aug 21 2016 16:10
@sorinr not sure what that means. Maybe?
@ashish1729 ok
I think I understand now, @ashish1729
Thanks!
ashish singh
@ashish1729
Aug 21 2016 16:12
@laurenconners cool
Sorin Ruse
@sorinr
Aug 21 2016 16:13
@laurenconners do you want something like lazy loading example ?
Lauren Conners
@laurenconners
Aug 21 2016 16:14
That's not what I was looking at, but I do like that. It's interesting
So that's JavaScript. I haven't learned how to do much with JS, yet.
Sorin Ruse
@sorinr
Aug 21 2016 16:18
@laurenconners there is a jquery plugin for lazy loading if you like it
Adam Pankowski
@losbaltica
Aug 21 2016 16:18
$(function () {
  var color = ['red', 'blue', 'yellow', 'green', 'black', 'pink', 'purple', 'grey'];
  var randomColor = color[Math.floor(Math.random ()*color.length)];
  $('.Mix_button').click(function{       $('body').css('background-color', randomColor);
                       });
});
I got problem with that... My console sad that is a problem with secound function {
I want to randomize the background color. Can you help me?
Lauren Conners
@laurenconners
Aug 21 2016 16:29
Are you missing () in the second function?
function () {
Adam Jacks
@AdamHJ123
Aug 21 2016 16:40
Guys, any idea why when I click the down arrow, the href doesn't leave margin at the top?
Adam Pankowski
@losbaltica
Aug 21 2016 16:42
@laurenconners yep correct i already manage it, but still function do not changing background :(
need help with js part
Gabriel Alexandre
@GabrielShaad
Aug 21 2016 16:58
Hey guys, can you give your opinion about my Portfolio page so far? https://codepen.io/gabrielshaad/full/BzLRdm/
Sorin Ruse
@sorinr
Aug 21 2016 17:02
@shailza you need a reset to zero to your counter. you can do this by using an if statement
Adam Pankowski
@losbaltica
Aug 21 2016 17:05

can somebody tell me why random color is not working properly? :(

http://codepen.io/codermaster/pen/LkvXqR?editors=1010

Shailza
@shailza
Aug 21 2016 17:08
@sorinr done! :D
Sorin Ruse
@sorinr
Aug 21 2016 17:10
@shailza hope this is what you wanted. to cycle the quotes over and over
ashish singh
@ashish1729
Aug 21 2016 17:11
@losbaltica coilors.length
not color.length
*colors.length
@losbaltica you have not included jquery
Hong
@designBuildShipSoftware
Aug 21 2016 17:29
Hi, how can I catch the error in api? I am working on twitchtv api. Here is my code:
It did not respond to the data.error in else if
Elbert Cortez
@trip16661
Aug 21 2016 17:32
@designBuildShipSoftware tip one
wrap your url or long strings into variable and re use them..
Hong
@designBuildShipSoftware
Aug 21 2016 17:33
@trip16661 What do you mean
you mean i need another $getJSON statement?
Elbert Cortez
@trip16661
Aug 21 2016 17:35
'https://api.twitch.tv/kraken/channels/'
'https://api.twitch.tv/kraken/streams/'
can be done as
var twitchApi = 'https://api.twitch.tv/kraken/';
// and then invoked 

$.getJSON(twitchApi +  "channels"
//or
$.getJSON(twitchApi +  "streams"
Hong
@designBuildShipSoftware
Aug 21 2016 17:36
@trip16661 Alright. what about error handling
Elbert Cortez
@trip16661
Aug 21 2016 17:37
@designBuildShipSoftware if status 422 then obj.message
Sorin Ruse
@sorinr
Aug 21 2016 17:41
@designBuildShipSoftware if(data.status === 422){alert('Account is closed');}
Hong
@designBuildShipSoftware
Aug 21 2016 17:45
@sorinr did it work for you? It did not show any alert
Elbert Cortez
@trip16661
Aug 21 2016 17:45
@designBuildShipSoftware and if that doesnt work use the error handler from the get
@designBuildShipSoftware
.fail(error => console.log(error));
sorry for es6 syntax
$.getJSON(function() {... your code}).fail(function (error) {
console.log(error)
});
Hong
@designBuildShipSoftware
Aug 21 2016 17:48
@trip16661 you are making me more confused. But I will try what you said since it looks interesting
Elbert Cortez
@trip16661
Aug 21 2016 17:49
@designBuildShipSoftware ok the get method from jquery, the one you use for ajax requests have a build in error handling function. which do something if an error in the get is throw
Tyler Moeller
@TylerMoeller
Aug 21 2016 17:51
@trip16661 This won't give them errors from the API, only jquery-related errors accessing the API. They need to test the JSON to look for valid properties - if none exist, account is closed, if data.stream is null, account is offline, else they're online.
Elbert Cortez
@trip16661
Aug 21 2016 17:52
@TylerMoeller who said that it doesnt give them errors from the api?
Tyler Moeller
@TylerMoeller
Aug 21 2016 17:53
@trip16661 Do you have a working example showing errors coming back from the Twitch API in the .fail() method?
Elbert Cortez
@trip16661
Aug 21 2016 17:53
it throws errors from the get functions but it grabs any object or error the api throws as well
@TylerMoeller use his code and use the fail method
and check the log
.fail(error => console.log(error.status))
or to be more clear to you
.fail(error => console.log(error.responseJSON.message));
edit: responseJSON instead of response (typo)
Sorin Ruse
@sorinr
Aug 21 2016 18:03
@designBuildShipSoftware sorry. it worked for me but looking at your code i saw you are using getJSON. I've used $.ajax with success and error. try the way @trip16661 told you. it should work
Elbert Cortez
@trip16661
Aug 21 2016 18:04
@sorinr its basically and essentially the same
its just syntactically different but both work the same way
either way i would recomend he do it on my way because thats basically how promises look like so he gets familiarized
Elbert Cortez
@trip16661
Aug 21 2016 18:11
@designBuildShipSoftware since you never came back I assume it worked xDD you are welcome xD
Sorin Ruse
@sorinr
Aug 21 2016 18:11
@trip16661 i know that but if he wants to use getJSON he should use the .fail. this is wat i was trying to say
Elbert Cortez
@trip16661
Aug 21 2016 18:12
does anyone need help?
Mikail Bayram
@mikail1998
Aug 21 2016 18:30
@trip16661 I do actually need help
http://codepen.io/mikail1998/pen/pbQjVN Before I added this else if ($("#result").text().slice(-1)==="/"||""||"+"||"-"&&clickedButton==="/"||""||"+"||"-"){
console.log('Math operation button clicked');
} the code worked when i added this calculator didnt do nothing
wiki help how to add code in chat
CamperBot
@camperbot
Aug 21 2016 18:32
no wiki entry for: help how to add code in chat
Moisés Man
@moigithub
Aug 21 2016 18:35
else if ($("#result").text().slice(-1)==="/"||"*"||"+"||"-"&&clickedButton==="/"||"*"||"+"||"-"){
u need to use backticks
ur if conditional expression have wrong syntax
u should do something like var ==="something" || var === "somethingElse"
Mikail Bayram
@mikail1998
Aug 21 2016 18:37
@moigithub backticks is not the problem
Moisés Man
@moigithub
Aug 21 2016 18:37
backticks used to post formatted code on this chat (it wont solve ur code problem ) :)
Sorin Ruse
@sorinr
Aug 21 2016 18:38
@mikail1998 to a lot of divs you forget to complete the col-xs-? and when you hover for example "/"
Roman Ferrante
@Stormin-Norman
Aug 21 2016 18:39
hello
my tribute page is done
lemme know what you guys think
Mikail Bayram
@mikail1998
Aug 21 2016 18:40
@sorinr i dont get you
Sorin Ruse
@sorinr
Aug 21 2016 18:41
@mikail1998 take a look at: <div class='col-md-3 col-xs-' id='division'> <p>/</p>
Mikail Bayram
@mikail1998
Aug 21 2016 18:42
@sorinr yeah i see but it didnt sort my problem out
Sorin Ruse
@sorinr
Aug 21 2016 18:43
@mikail1998 i was not talking about the sort problem but the UI
Moisés Man
@moigithub
Aug 21 2016 18:43

on ur if code above.. as i said above.. u doing something like
if(myVar === 1||2||3||4 ) { ... } <-- wrong
u should do something like
if(myVar === 1||myVar === 2|| myVar === 3||myVar === 4){ .... }

@mikail1998

Hong
@designBuildShipSoftware
Aug 21 2016 18:44
@trip16661 @sorinr Hi I'm back from nursing my baby. Thank you both! I will try them out :)
CamperBot
@camperbot
Aug 21 2016 18:44
designbuildshipsoftware sends brownie points to @trip16661 and @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 464 | @trip16661 |http://www.freecodecamp.com/trip16661
:cookie: 677 | @sorinr |http://www.freecodecamp.com/sorinr
Sorin Ruse
@sorinr
Aug 21 2016 18:52
@mikail1998 when you use CE (clear entry) means that only the last entry is cleared. you are clearing all previous entries that is more of a C on a calculator and it means clear all
Moisés Man
@moigithub
Aug 21 2016 19:00

another way to do (what above code does) is using arrays methods... ie...

var myValues = [1,2,3,4];
if( myValues.includes( myVar ) ) {  ..... }

@mikail1998

Mikail Bayram
@mikail1998
Aug 21 2016 19:08
@moigithub i will now try your code
i mean your way
Hong
@designBuildShipSoftware
Aug 21 2016 19:11
@trip16661 @sorinr The .fail() method worked for me. .fail didn't fail.
Hong
@designBuildShipSoftware
Aug 21 2016 19:19
Mikail Bayram
@mikail1998
Aug 21 2016 19:26
@moigithub again nothing
but thank you for trying to help
@moigithub thank you
CamperBot
@camperbot
Aug 21 2016 19:26
mikail1998 sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 1960 | @moigithub |http://www.freecodecamp.com/moigithub
Moisés Man
@moigithub
Aug 21 2016 19:39
@mikail1998 well.. the syntax still wrong u didnt fixed....
to test ur code.. which IF block reach.. (flow execution) add DIFFErents console.log messages to each block... not the same text
if u still Not sure.. why ur block dont execute.. then evaluate each part of ur if condition expression separatedly above..
ie: console.log($("#result").text());
do u understand the concepts of "truthy" / "falsy".. ?
var test = false;
if (test) { console.log("meeee");}
else { console.log("booo"); }

Which message do u think it will log on console ???

Moisés Man
@moigithub
Aug 21 2016 19:45
false, undefined, "" (empty string), 0, null
are falsy values... everything else are truthy
@mikail1998
soo check this condition... is correct ??
var b=1;
var a = 1;
if (a || b < 0) {
   console.log("a or b are less than 0");
} else { 
     console.log("zzzzzz")  ;
}
kennyq94
@kennyq94
Aug 21 2016 20:20
hey everyone is this the correct code to get navigator to work on your browser, I wonder why it is not prompting me to use my location... pls help
if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(location, error);
} else {
  alert("Geolocation not supported");
}

function error() {
  alert("Sorry you are in outer space");
}
encount
@encount
Aug 21 2016 20:26
@kennyq94 I does not work in chrome
Zacch McKinney
@ZacchMckinney
Aug 21 2016 20:27
Hello, I am having trouble getting my text to center in all screens on my tribute page. Can anyone help?
http://codepen.io/SeaWeasel/pen/oLOryL
Ayyaz Zafar
@ayyazzafar
Aug 21 2016 20:29
Hello Everyone !
I need help regarding HTML5 video player. I have a mp4 video.
IT plays very well in desktop browser but if I play it in mobile browser then orientation is changed.
Why is that happening and how can I fix this?
Joe
@JoeMethven
Aug 21 2016 20:50
@moigithub you need a < 0 for "a" on that if statement.
The the code between each || pipe is separate, you can't assume < 0 applies to both statements, as if the first rule is true (above 0 in this case) it will never check the second statement
Moisés Man
@moigithub
Aug 21 2016 20:53
@JoeMethven that was an example/test for @mikail1998 :)
Joe
@JoeMethven
Aug 21 2016 20:53
Yeah just realised, didn't read up 👍
Dylan
@dhcodes
Aug 21 2016 20:55
@ayyazzafar seems you need to transcode the video with the rotation you want: http://stackoverflow.com/questions/29920331/video-orientation-is-incorrect-on-firefox
Ayyaz Zafar
@ayyazzafar
Aug 21 2016 20:59
Thanks @dhcodes for reply.
Actually it's working fine in Desktop but not in mobile / android chrome. If I rotate orientation then it will be rotated in desktop where it was showing fine
CamperBot
@camperbot
Aug 21 2016 20:59
ayyazzafar sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1346 | @dhcodes |http://www.freecodecamp.com/dhcodes
Will Kempster
@kempsterrrr
Aug 21 2016 21:06
Hi! I am stuck on the Wikipedia Viewer project. At the moment I trying to call the Wiki API but getting "No 'Access-Control-Allow-Origin' header is present on the requested resource" as an error. I believe I need to use CORS (please correct me If i am wrong) but i cannot find any good tutorials on this subject. Does anyone have suggestions on where to look?
Ayyaz Zafar
@ayyazzafar
Aug 21 2016 21:08
@WilliamFace there can be many solutions for this. But one of the solution is that you upload your app / script on a live hosting instead of localhost. That way I hope it will resolve your isue.
kennyq94
@kennyq94
Aug 21 2016 21:09

hi guys my code isn't working at all I cannot get the temperature back from the call any idea why ? plssss help me.
var lat, lon, weather;
if ('geolocation' in navigator) {
navigator.geolocation.getCurrentPosition(location, error);
} else {
alert("Geolocation not supported");
}

function error() {
alert("Sorry you are in outer space");
}

function location(position) {
lat = position.coords.latitude;
lon = position.coords.longitude;

weather = "api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&units=metric&APPID=";

$.ajax({
url: weather,
dataType: 'jsonp',
success: function(data) {
var temp = data.main.temp;
$("#temp").html(temp);
}

});
}
I didnt want to share my api

Will Kempster
@kempsterrrr
Aug 21 2016 21:10
@ayyazzafar thanks for replying. I am doing the task on codepen and not locally hosting, is that okay?
CamperBot
@camperbot
Aug 21 2016 21:10
williamface sends brownie points to @ayyazzafar :sparkles: :thumbsup: :sparkles:
:cookie: 8 | @ayyazzafar |http://www.freecodecamp.com/ayyazzafar
kennyq94
@kennyq94
Aug 21 2016 21:10

sorry this one is more organized

var lat, lon, weather;
if ('geolocation' in navigator) {
  navigator.geolocation.getCurrentPosition(location, error);
} else {
  alert("Geolocation not supported");
}

function error() {
  alert("Sorry you are in outer space");
}

function location(position) {
  lat = position.coords.latitude;
  lon = position.coords.longitude;

  weather = "api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&units=metric&APPID=";

  $.ajax({
    url: weather,
    dataType: 'jsonp',
    success: function(data) {
      var temp = data.main.temp;
      $("#temp").html(temp);
    }

  });
}

I didnt want to share my api

Dylan
@dhcodes
Aug 21 2016 21:12
@WilliamFace can you paste you codepen link?
you likely need to add &callback=? to the end of your url
Ayyaz Zafar
@ayyazzafar
Aug 21 2016 21:13
@WilliamFace there are possibilities that codepen has some restrictions. But please share your codepen. May be we can find some solution for you.
Will Kempster
@kempsterrrr
Aug 21 2016 21:13
@dhcodes of course, here we go: http://codepen.io/dilliam/pen/rLbxZV
I have been messing around with this for about an hour now and changed a lot so there may be some stupid errors that I am not picking up :/
Dylan
@dhcodes
Aug 21 2016 21:18
well i think it may be the s in https
but even if i remove it, it calls the https page
so idk, still messing with it
Will Kempster
@kempsterrrr
Aug 21 2016 21:19
I had that issue with the weather App and ended up using this URL proxy service - https://crossorigin.me/
But no matter what I do I can't make this one work. I even tried copying in code from tutorials (forgive me) just too see if I as going mad but it was still throwing the same error
Dylan
@dhcodes
Aug 21 2016 21:22
@WilliamFace i just used that prepend and it did work
add an s to your codepen url
https:// your codepen link
prepend your url with https://crossorigin.me
change your success function to console.log(request)
and you will see an XML return in the console
@WilliamFace fwiw, I find that jquery.getJSON is an easier approach for apis or AJAX even may be easier than XML
but that could be because I don't know how to parse XML
if you want, I can fork your project
and send a link
Will Kempster
@kempsterrrr
Aug 21 2016 21:25
If you could, I'd be really grateful
Just added the s to http and appended with https://crossorigin.me and the error has gone but the API is still not being called and not adding the response text to searchObj
@dhcodes maybe I am just trying to be too clever no using get.JSON! I did the weather app with it and then re-wrote it for practice with vanilla js, thought I could go ahead and do this one in vanilla but obviosuly not :smile:
*not using get.JSON
here you go
Will Kempster
@kempsterrrr
Aug 21 2016 21:36
@dhcodes thanks!! Finally it's called the API :smile: for someone reason though it wont parse the responseText to JSON when using JSON.prase(request.responseText)
CamperBot
@camperbot
Aug 21 2016 21:36
williamface sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1347 | @dhcodes |http://www.freecodecamp.com/dhcodes
Will Kempster
@kempsterrrr
Aug 21 2016 21:37
Which is really weird as the information is clearly there in responseText
Dylan
@dhcodes
Aug 21 2016 21:46
@WilliamFace i think it's because your response is coming back as xml and not json
Will Kempster
@kempsterrrr
Aug 21 2016 21:47
@dhcodes ahhhhhhh that makes sense ! The error it is throwing up now is 'unexpected / at position blah blah' which must be the / at the start of the XML
Dylan
@dhcodes
Aug 21 2016 21:50
yeah, i'm not sure there's a good way to convert it from xml though
idk why it isn't giving json since you request that in the format
Will Kempster
@kempsterrrr
Aug 21 2016 21:52
yeah it's really weird, I actually think it is returning JSON but /**/( is appended to the start of the file so you can't use JSON.parse
never seen that before
Just tried it on my weather app and the /**/( is not there
Stephen James
@sjames1958gm
Aug 21 2016 21:54
@WilliamFace Can you save your codepen page, I'd like to take a look at the latest.
Dylan
@dhcodes
Aug 21 2016 21:54
@WilliamFace yeah but if you console.log(request.responseText) it is definitely xml
Will Kempster
@kempsterrrr
Aug 21 2016 21:56
@sjames1958gm here you go https://codepen.io/dilliam/pen/rLbxZV
Leena
@leena-d
Aug 21 2016 21:59
can someone help me?
Dylan
@dhcodes
Aug 21 2016 21:59
we can try
what's up
Leena
@leena-d
Aug 21 2016 22:00
i can't figure out how to change the colors of my navbar. any help is greatly appreciated
https://codepen.io/leena-d/pen/kXmzNN
Dylan
@dhcodes
Aug 21 2016 22:01
@leena-d you have set the background-color to black
Stephen James
@sjames1958gm
Aug 21 2016 22:01
@WilliamFace Since you are using that proxy URL - remove callback=? and change format back to json.
Dylan
@dhcodes
Aug 21 2016 22:02
do you mean the hover states @leena-d
Will Kempster
@kempsterrrr
Aug 21 2016 22:02
@sjames1958gm YES!
Stephen James
@sjames1958gm
Aug 21 2016 22:02
@WilliamFace - console.log(searchObj.response);
Dylan
@dhcodes
Aug 21 2016 22:02
@sjames1958gm do you know what was causing that?
i'm curious
Will Kempster
@kempsterrrr
Aug 21 2016 22:04
me too
oddly it still wont parse to a JSON object.... searchObj = JSON.parse(request.responseText); is still not working
Stephen James
@sjames1958gm
Aug 21 2016 22:04
When I entered that URL without the crossorigin proxy into my browser it was giving back html page. when i changed it back to json it appeared the response was the JSONP callback code
/**/ - I am not sure but the jsonp I have seen starts with /**/ but not sure.
@WilliamFace JSON.parse(request.response)
Will Kempster
@kempsterrrr
Aug 21 2016 22:07
I think the format in the URL was wrong so it was reverting back to it's default
@sjames1958gm that parse worked, thanks.
CamperBot
@camperbot
Aug 21 2016 22:07
williamface sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2776 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Dylan
@dhcodes
Aug 21 2016 22:08
cool
i'm out happy coding
Stephen James
@sjames1958gm
Aug 21 2016 22:08
@WilliamFace :+1:
Will Kempster
@kempsterrrr
Aug 21 2016 22:08
Cheers @dhcodes
@sjames1958gm not sure why parse wont work to assign the searchObj with that value thought. Maybe I am getting scope wrong or maybe just a typo somewhere
*though
Leena
@leena-d
Aug 21 2016 22:10
@dhcodes i mean the active and hover states
Stephen James
@sjames1958gm
Aug 21 2016 22:11
@WilliamFace Not sure what you mean
Rony
@Rony126
Aug 21 2016 22:11
I have arrived to the build a Tribute Page and should I use the same font family and size that are used in the example project ?
Stephen James
@sjames1958gm
Aug 21 2016 22:11
@Rony126 Use whatever you want.
Will Kempster
@kempsterrrr
Aug 21 2016 22:11
@sjames1958gm GOT IT. THANK GOD. I'd set the searchObj globally as an object when what is being returned by the API is an array
CamperBot
@camperbot
Aug 21 2016 22:11
williamface sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: williamface already gave sjames1958gm points
Rony
@Rony126
Aug 21 2016 22:11
Alright thanks @sjames1958gm
CamperBot
@camperbot
Aug 21 2016 22:11
rony126 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2777 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 21 2016 22:11
@WilliamFace YAY!
Will Kempster
@kempsterrrr
Aug 21 2016 22:11
hahaha
only about an hou after I should have gone to sleep for work tomorrow :smile:
Rony
@Rony126
Aug 21 2016 22:15
So I can write about anyone I want basically?
Will Kempster
@kempsterrrr
Aug 21 2016 22:16
@Rony126 yes, probably keep it friendly though :smile:
Rony
@Rony126
Aug 21 2016 22:25
Lol yes, I will write theirs since it is easier
Zacch McKinney
@ZacchMckinney
Aug 21 2016 22:26
Can someone help me please? I am having trouble with text on my tribute page. It jumps out of the container at different screen sizes and My footer realigns up to the right of the body text. Well, in code pen at least it does...
E. Vazquez
@joufflu
Aug 21 2016 22:51
if i want to update an object's properties by changing to them all to "foobar" how can I do this? I am thinking of using for..in loop.
Adam Jacks
@AdamHJ123
Aug 21 2016 22:53
Guys, any idea how I an make the text look better here: http://codepen.io/AdamHJacks/pen/NAmkzr
Stephen James
@sjames1958gm
Aug 21 2016 22:53
@joufflu for .. in is good
Object.keys(obj).forEach(function(k) { obj[k] = "foobar";});
Susan
@SusanGrattan
Aug 21 2016 23:16
Has anyone had experience adding animations to the wiki viewer? I tried using animate.css for the little article previews but it doesn't work. I'm thinking I'll have do do something in the JS.