These are chat archives for FreeCodeCamp/HelpFrontEnd

29th
Feb 2016
Lanitta
@DivaWeb
Feb 29 2016 00:01
@DanStockham yeah I see what your saying the principle is wright so it looks like it needs some tweeking
Dan Stockham
@DanStockham
Feb 29 2016 00:11
It's weird. When there is one space left, the computer player will take it, I return a draw in the console, and the other player is claimed the winner.
Lane Anderson
@LaneAnderson
Feb 29 2016 00:12
I'm having a difficult time getting this to work:
$("button").click(function() {
$('html, body').animate({
scrollTop: $("footer").offset().top
}, 2000);
});
I have a simple button with the id "button", and a div with the id "footer". when I click the button, nothing happens at all.
missing "#"s........ never mind, sorry! Got it to work.
Dustin
@Key-Banger
Feb 29 2016 00:16
@LaneAnderson was typing that. You got there first :smile:
I had that same issue before. jQuery I think is a little different with selectors.
Nico Vancamp
@NiVanc
Feb 29 2016 00:18
Hello everyone. I’m working on the "Build a Personal Portfolio Webpage” assigment. I’m wireframing everything out but I have a white spacing between my sections and I can’t find the cause. Could anyone take a loot at it and help me out? It would be much appretiated. http://codepen.io/NiVanc/full/vGYQwN/
Dustin
@Key-Banger
Feb 29 2016 00:19
Would someone mind look at my javascript. I'm having a hard time getting to the JSON I want. http://codepen.io/Key-Banger/pen/RrzqKK?editors=1010
@NiVanc you can do margin-bottom: -20px; that will pull everything up.
Lanitta
@DivaWeb
Feb 29 2016 00:23
@NiVanc you have to fix the padding between the pages
Nico Vancamp
@NiVanc
Feb 29 2016 00:24
But the strange thing is that I can’t see any padding or margin when inspecting it.
Lanitta
@DivaWeb
Feb 29 2016 00:25
@Key-Banger I am not a json expert but I did notice that your vars don't have ;
@NiVanc yeah I know but that is what you have to do is add padding to the top
Davide
@DavOnGit
Feb 29 2016 00:26
@Key-Banger
i've used this:
$.ajax({
      url: '//en.wikipedia.org/w/api.php?',
      data: { format: 'json', action: 'query', generator:'search', gsrnamespace: 0, gsrlimit: 10, prop: 'pageimages|extracts', piprop: 'thumbnail', pilimit:'10', exsentences: 1, explaintext:true, exintro:true, exlimit:'max', gsrsearch: input, redirects: 'resolve', formatversion: 2, callback:'myCallback' },
      dataType: 'jsonp'
});
Nico Vancamp
@NiVanc
Feb 29 2016 00:27
@DivaWeb I’ll try that.
Lanitta
@DivaWeb
Feb 29 2016 00:27
@NiVanc just add it in your css I found out about it by doing some research because I had the same problem when I did mine
Dustin
@Key-Banger
Feb 29 2016 00:28
@DivaWeb thanks I'll clean those up.
CamperBot
@camperbot
Feb 29 2016 00:28
key-banger sends brownie points to @divaweb :sparkles: :thumbsup: :sparkles:
Nico Vancamp
@NiVanc
Feb 29 2016 00:28
@DivaWeb Thanks a lot! Is it a bug? Because padding-top: 1px; resolves the issue. Really strange.
CamperBot
@camperbot
Feb 29 2016 00:28
:star: 240 | @divaweb | http://www.freecodecamp.com/divaweb
Dustin
@Key-Banger
Feb 29 2016 00:29
@DavOnGit thanks, I'll look into ajax. Haven't used it much.
Lanitta
@DivaWeb
Feb 29 2016 00:29
@NiVanc no it just needs the padding to bring them together it has something to do with the scrollspy
Nico Vancamp
@NiVanc
Feb 29 2016 00:30
@DivaWeb Oh ok.
Mark Lawrence
@ninja-ml
Feb 29 2016 01:24
i was wondering while trying to loop through JSON, is forEach the same as .each() ?
Evan Mena
@Hoenn
Feb 29 2016 01:28
Can anyone give me some direction as to where to find backgrounds for web pages?
finding a lot of pay content. Is there some good site for backgrounds I'm not finding?
Clarence W.
@leo81202
Feb 29 2016 01:44
@Hoenn use google the view images
then just copy the image location

I need help with my wikipedia zipline I keep getting

XMLHttpRequest cannot load https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=butterflies&redirects=resolve. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access.

is there anyway around that, here is a link to my project http://codepen.io/Leo81202/pen/dMywbP?editors=1011

Mark Lawrence
@ninja-ml
Feb 29 2016 01:51
@leo81202 try adding &callback=? to the end of your api call
Clarence W.
@leo81202
Feb 29 2016 01:52
Thanks @ninja-ml
CamperBot
@camperbot
Feb 29 2016 01:52
leo81202 sends brownie points to @ninja-ml :sparkles: :thumbsup: :sparkles:
Clarence W.
@leo81202
Feb 29 2016 01:52
that worked
CamperBot
@camperbot
Feb 29 2016 01:52
:star: 321 | @ninja-ml | http://www.freecodecamp.com/ninja-ml
Mark Lawrence
@ninja-ml
Feb 29 2016 02:01
@leo81202 i've experienced that problem recently too
Travmatth
@Travmatth
Feb 29 2016 02:11
I created the magnifying glass animation in wikipedia viewer, but i’m looking for a way to ‘anchor’ the tail of the magnifying glass to the input element itself, such that it stays attached regardless of the screen size http://codepen.io/TravMatth/pen/WwNzdj?editors=1100
Julian Betancourt
@julianbetancourt
Feb 29 2016 02:18
hi guys, with jquery, how do i test if an element's children has x class ?
<li class="employee"><span class="out status">OUT</span> Aimee</li>
<li class="employee"><span class="in status">IN</span> Aimee</li>

if ($('.employee').children().hasClass( "in" )) {
  $(this).css('color', 'pink');
}
Aseel
@aseelsky
Feb 29 2016 02:26
Hello camper! I have a question. I notice when I first opened the weather app provided by fCC in the Zipline: Show the Local Weather, it didn’t ask for permission to get access to my location, do anyone know why is that?
Sravani Vegesna
@sravanivegesna
Feb 29 2016 02:28
Can any one help me ,where can i found Api call .I checked with below link. but I was unable to get response . Asking for subscribe.
https://market.mashape.com/healthruwords/universal-inspirational-quotes
Lanitta
@DivaWeb
Feb 29 2016 02:29
wstrauss123
@wstrauss123
Feb 29 2016 02:58
did anyone here complete the local weather zipline?
Ken Haduch
@khaduch
Feb 29 2016 02:59
@julianbetancourt - if you are using ".children()", then you probably also have to be prepared to handle a list or something like ".each" to look at them individually? I'm looking at the documentation page. It says that you can also pass a filter to the .children, so if you wanted to find those children elements with the class "in", perhaps you can use ".children('.in')"? I would have to try it because I'm not as familiar with these parts of jquery as I would like to be!
Coy Sanders
@coymeetsworld
Feb 29 2016 03:01
@wstrauss123 getting close to finishing it
Ken Haduch
@khaduch
Feb 29 2016 03:02
but it only goes down 1 level to look for children, so you have to pick the correct parent...
Aseel
@aseelsky
Feb 29 2016 03:03
@wstrauss123, I’m working on nowdays, it’s giving me hard time
wstrauss123
@wstrauss123
Feb 29 2016 03:07
I tried two different API's and they aren
aren't accurate.
I'll try the weatherunderground next, I guess
Coy Sanders
@coymeetsworld
Feb 29 2016 03:07
just use the one they recommend @wstrauss123 , http://openweathermap.org/
works fine with me
wstrauss123
@wstrauss123
Feb 29 2016 03:09
When I try and use openweathermap, it gives me 10 degrees under
Ken Haduch
@khaduch
Feb 29 2016 03:09

@julianbetancourt - something like this adds a class to the children objects that have the class 'in':

$('#employees').children('.in').addClass('green');

I tested it with a top-level div, having several nested divs as children. Here is a jsfiddle with simple code: https://jsfiddle.net/khaduch/oy07nvLq/

Coy Sanders
@coymeetsworld
Feb 29 2016 03:13
that's strange, but I don't think that really matters
the idea is to get you working with another API and JSON, even if it's a little inaccurate who cares?
Mark Lawrence
@ninja-ml
Feb 29 2016 03:14
@wstrauss123 I used the forecast.io Dark Sky API
wstrauss123
@wstrauss123
Feb 29 2016 03:14
@ninja-ml is used that too and it's giving me 10 degrees above the forecast.io website for my location.
Mark Lawrence
@ninja-ml
Feb 29 2016 03:15
@wstrauss123 that's weird, mine gave accurate results
wstrauss123
@wstrauss123
Feb 29 2016 03:16
@ninja-ml does the currently.temperature give the current temparature in degrees F?
no conversion is needed?
the openweathermap api give temp in Kelvin which needs converting to degrees F
The forecast.io Dark Sky API is what I have a question about. It give degree F as is?
Coy Sanders
@coymeetsworld
Feb 29 2016 03:22
@wstrauss123 maybe check the coordinates your geo function is giving
is it accurate on Google maps?
wstrauss123
@wstrauss123
Feb 29 2016 03:22
let me check
how do I pull up my coordinates on Google maps?
I checked and the coordinates are accurate within 100th of a decimal place.
It's not a coordinates problem unless I have to convert the coordinates from text type to a number type.
Mark Lawrence
@ninja-ml
Feb 29 2016 03:27
@wstrauss123 if i remember right, it gives you the temperature in F. i think you can change the api call to give you temperature in a different measurement
wstrauss123
@wstrauss123
Feb 29 2016 03:28
@ninja-ml I need it in F, so that's not the problem I'm having.
Can you share your api call. Here is mine:
Coy Sanders
@coymeetsworld
Feb 29 2016 03:29
i forgot where it was mentioned @wstrauss123 , but i think you can just input the coordinates in google maps
and it will go to that location, see if that's where you're located
Mark Lawrence
@ninja-ml
Feb 29 2016 03:30
@wstrauss123 here's a link to my project http://codepen.io/ninja-ml/pen/PZyYwL
wstrauss123
@wstrauss123
Feb 29 2016 03:30
json.currently.temperature
json is the Object returned the the getJSON call
ok, let me check to see
Mark Lawrence
@ninja-ml
Feb 29 2016 03:31
it looks like thats what i used
wstrauss123
@wstrauss123
Feb 29 2016 03:36
Here is a piece of my code: var fahrenheit = Math.round(parseInt(json.currently.temperature)) + '\u00B0' + 'F';
maybe I have an error in the above code?
Sophanarith Sok
@sok213
Feb 29 2016 03:37
For React, I would like to store the states within the user's local storage. I have found the React-localstorage library on GitHub and I was wondering if any of you know if it is required to have Node in order for this to work?? I want to have the save local storage functionality on a codepen project so Node will not be an option for me.
any help would be greatly appreciated thanks
wstrauss123
@wstrauss123
Feb 29 2016 03:37
I believe local storage doesn't need node.js
Sophanarith Sok
@sok213
Feb 29 2016 03:38
@wstrauss123 Would I have to use this specific library or is the localstorage functionality built into react??
Mark Lawrence
@ninja-ml
Feb 29 2016 03:38
@wstrauss123 do you need parseInt?
wstrauss123
@wstrauss123
Feb 29 2016 03:39
@sok213 I used this: localStorage.setItem("name1", "Hannah");
for example
Sophanarith Sok
@sok213
Feb 29 2016 03:40
@wstrauss123 Hmm, ok thanks, Ill try something like that.
CamperBot
@camperbot
Feb 29 2016 03:40
sok213 sends brownie points to @wstrauss123 :sparkles: :thumbsup: :sparkles:
:star: 261 | @wstrauss123 | http://www.freecodecamp.com/wstrauss123
wstrauss123
@wstrauss123
Feb 29 2016 03:41
@ninja-ml let me get rid of the parseInt
@sok213 localStorage.getItem()
//localStorage.setItem("name1", "Hannah");
//localStorage.setItem("name2", "Sarah");
alert( "The name in local web storage: " + localStorage.getItem("name1") + " " + localStorage.getItem("name2"));
//alert( "The name in local web storage: " + localStorage.key(0) + " " + localStorage.key(1));
//localStorage.clear();
//localStorage.removeItem("name1");
//localStorage.removeItem("name2");
//alert( "The name should now be deleted in local web storage: " + localStorage.getItem("name") + " " + localStorage.getItem("name2"));
Sophanarith Sok
@sok213
Feb 29 2016 03:44
@wstrauss123 awesome
Gordon Davidescu
@gordondavidescu
Feb 29 2016 03:46
@ninja-ml that's beautiful
I've been struggling with getting any api to work all day
wstrauss123
@wstrauss123
Feb 29 2016 03:48
@sok213 the above local storage stuff was done only using javascript for the browser. Nothing node.js or react.js
@ninja-ml I'm going to try hosting my code on some server just to see if it's just my machine.
Sophanarith Sok
@sok213
Feb 29 2016 03:51
@wstrauss123 I see, I never knew Javascript had a localstorage function. Now I do, thanks again.
CamperBot
@camperbot
Feb 29 2016 03:51
sok213 sends brownie points to @wstrauss123 :sparkles: :thumbsup: :sparkles:
:warning: sok213 already gave wstrauss123 points
Gordon Davidescu
@gordondavidescu
Feb 29 2016 03:53
I'll be honest @ninja-ml maybe it's because I'm tired but I am having a hard time reading your JS -- the end result is quite beautiful
Mark Lawrence
@ninja-ml
Feb 29 2016 03:58
@gordondavidescu thanks... a lot of times i feel like I don't know what I'm doing
i'm trying to get the twitch tv api calls to work now
CamperBot
@camperbot
Feb 29 2016 03:58
ninja-ml sends brownie points to @gordondavidescu :sparkles: :thumbsup: :sparkles:
:star: 382 | @gordondavidescu | http://www.freecodecamp.com/gordondavidescu
Mark Lawrence
@ninja-ml
Feb 29 2016 03:58
@wstrauss123 i have a chromebook but i code on cloud9 which hosts the code
Gordon Davidescu
@gordondavidescu
Feb 29 2016 04:08
wow
I also have a chromebook
Dulshani Gunawardhana
@dshgna
Feb 29 2016 04:08
@sok213 I think you can use redux for handling local storage and sessions, though I haven't got to that part as yet
Gordon Davidescu
@gordondavidescu
Feb 29 2016 04:08
I am having such a hard time with this challenge
I feel like every weather API says to me, screw you, I will not work
iamthedrag
@iamthedrag
Feb 29 2016 04:28
i also use a chromebook!
Mark Lawrence
@ninja-ml
Feb 29 2016 04:31
i have a macbook but never use it anymore... i love the battery life of the chromebook
wstrauss123
@wstrauss123
Feb 29 2016 04:45
@ninja-ml Thanks for helping me. It's has something to do with my location, I think. The API probably can't cover every location accurately.
CamperBot
@camperbot
Feb 29 2016 04:45
wstrauss123 sends brownie points to @ninja-ml :sparkles: :thumbsup: :sparkles:
:star: 322 | @ninja-ml | http://www.freecodecamp.com/ninja-ml
Mark Lawrence
@ninja-ml
Feb 29 2016 04:46
@wstrauss123 you're welcome, sorry i couldn't be of more help
Neptune Michael Cabelin
@ncabelin
Feb 29 2016 04:59
Hey people how did you guys do the wikipedia API? ajax is requesting a header be sent, I can’t for the life of me figure out what header to put
dcjuju
@dcjuju
Feb 29 2016 05:45
someone knows velocity?
Jason
@carpediem1213
Feb 29 2016 05:58
how do you make a website responsive if it has a background-image with size: cover?
Boris
@boris-in-london
Feb 29 2016 05:59
@carpediem1213 you want the image to change size as the browser window changes in size?
Jason
@carpediem1213
Feb 29 2016 06:00
@boris-in-london Yes I'd like for that to happen
Boris
@boris-in-london
Feb 29 2016 06:00
bootstrap has a image responsive class.
Jason
@carpediem1213
Feb 29 2016 06:01
yes, but background image doesn't work right? only img?
Boris
@boris-in-london
Feb 29 2016 06:01
but it needs to be nested in a parent div. so idk how that would work with the body tag
something to check out
you can nest a div in the body and make height & width 100%
Matt Green
@mattxgreen
Feb 29 2016 06:02
@carpediem1213 try background-size:100% auto;
Jason
@carpediem1213
Feb 29 2016 06:02
@mattxgreen @boris-in-london Thanks! I'll try that
CamperBot
@camperbot
Feb 29 2016 06:02
carpediem1213 sends brownie points to @mattxgreen and @boris-in-london :sparkles: :thumbsup: :sparkles:
:star: 302 | @boris-in-london | http://www.freecodecamp.com/boris-in-london
:star: 52 | @mattxgreen | http://www.freecodecamp.com/mattxgreen
Bruce Young
@mutantspore
Feb 29 2016 07:32
@gordondavidescu sorted the weather API out ?
Joshua McKenzie
@mckenzieja
Feb 29 2016 08:21
Speaking of the Weather API, is anybody else having issues viewing their weather application via "Full" on codepen?
kirbyedy
@kirbyedy
Feb 29 2016 08:23
nope
Ali Muhammad
@Ali-Elsbaee
Feb 29 2016 08:25
Hey campers what is your feedback on "Tic Tac Toe game" project ??
beat my code if you can :D
http://codepen.io/AliMuhammed/full/MKNweo
Joshua McKenzie
@mckenzieja
Feb 29 2016 08:30
My Pen works in Editor Mode but not in Full or in Debug. Advice?
http://codepen.io/mckenzieja/pen/MKRZgj
kirbyedy
@kirbyedy
Feb 29 2016 08:34
your console log says Uncaught SyntaxError: Unexpected token ;
line 66 apparently
Joshua McKenzie
@mckenzieja
Feb 29 2016 08:39
I'll check it out... thanks @kirbyedy
CamperBot
@camperbot
Feb 29 2016 08:39
metaljacke1 sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 563 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
Harry Aydin
@HMAN1911
Feb 29 2016 09:15
@AliMuhammed Let me make the first move ;)
Gordon Davidescu
@gordondavidescu
Feb 29 2016 09:32
@metaljacke1 funny weather app -- nice work
I'm struggling a bit with the weather app -- is anyone up
kirbyedy
@kirbyedy
Feb 29 2016 09:39
just write your problem, someone will get involved, dont worry
Gordon Davidescu
@gordondavidescu
Feb 29 2016 09:40
heh, thank you. ok so I can output the information to the console log -- see here : http://codepen.io/gordondavidescu/pen/jWjBbg
but when i set a variable name (cityName) and put it out to the HTML, suddenly it is undefined
I had a way easier time doing tic tac toe and that is supposed to be advanced versus this (intermediate)
Gordon Davidescu
@gordondavidescu
Feb 29 2016 09:45
ok. I'm wiping it and starting fresh. have to try another new approach.
ottomahn
@ottomahn
Feb 29 2016 09:48
var url='https://en.wikipedia.org/w/api.php?callback=?&action=opensearch&search='+input+'&limit=10&namespace=0&format=json';
 $.getJSON(url, function(data) {
   jsonData = data;
   document.getElementById("result2").innerHTML = 'gggg'


 });
guyz help the statements inside the function doesnt gets executed?
What could be wrong here?
J Player
@Heyjp
Feb 29 2016 09:57
I think the URL is wrog
wrong* but right now I can't tell why, give me a few
Gordon Davidescu
@gordondavidescu
Feb 29 2016 09:58
tried again. failed again.
using weather underground's api as it is also free
with city and state lookup, no problem
as soon as I use their latitude and longitude lookup, problem
it just entirely stops functioning.
anthonygallina1
@anthonygallina1
Feb 29 2016 10:00
@gordondavidescu have you tried looking in chrome dev tools for the error?
Gordon Davidescu
@gordondavidescu
Feb 29 2016 10:01
yeah
when I use the city and state call, it works
when I use the lat and long call, which they supply, it says that there is no data
I love the chrome dev tools
Mridul
@mridulmishra22
Feb 29 2016 10:01
@media(max-width:767px) {
.intro-message {
padding-bottom: 15%;
}
What does above code mean?
Gordon Davidescu
@gordondavidescu
Feb 29 2016 10:02
looks like CSS
Mridul
@mridulmishra22
Feb 29 2016 10:02
What @ used for?
Gordon Davidescu
@gordondavidescu
Feb 29 2016 10:02
that gives a bit of padding on the bottom
that @ looks like it should not be there
anthonygallina1
@anthonygallina1
Feb 29 2016 10:02
@gordondavidescu have you tried dot notation to acess the json key?
Gordon Davidescu
@gordondavidescu
Feb 29 2016 10:03
I have not -- i will have to try it a bit later, it's time to get my workout on. :) thanks @anthonygallina1
CamperBot
@camperbot
Feb 29 2016 10:03
gordondavidescu sends brownie points to @anthonygallina1 :sparkles: :thumbsup: :sparkles:
:star: 1005 | @anthonygallina1 | http://www.freecodecamp.com/anthonygallina1
anthonygallina1
@anthonygallina1
Feb 29 2016 10:04
@gordondavidescu Exercise I vaugly remember that ;) Enjoy And happy coding
J Player
@Heyjp
Feb 29 2016 10:04
alright never mind what I just said @ottomahn I got it to work fine when using $.ajax
ottomahn
@ottomahn
Feb 29 2016 10:07
@Heyjp hmmm its worth a shot........
Mridul
@mridulmishra22
Feb 29 2016 10:10
"@media(max-width:767px) {
.intro-message {
padding-bottom: 15%;
}"
I found @ in few other linse also in that code. Seems it's there for some purpose. Looks more like javascript function. This code is from the html of page below: http://codepen.io/FreeCodeCamp/pen/VemmoX
Mridul
@mridulmishra22
Feb 29 2016 10:21
@kirbyedy Thanks
CamperBot
@camperbot
Feb 29 2016 10:21
mridulmishra22 sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 570 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
Matthew Stettner
@mstettner
Feb 29 2016 10:23
how is everyone doing in this project. I'm about to start. how many hours should I expect?
kirbyedy
@kirbyedy
Feb 29 2016 10:28
alot
Gordon Davidescu
@gordondavidescu
Feb 29 2016 10:48
ok tried dot notation -- might be doing it wrong -- it still is struggling to find data
as you can see, it is outputting... squat
if all goes well I will be out of the shower in < 10 minutes. can someone look at that and give me a clue where I am going wrong
and I can have an aha moment after two days of grinding on this same issue :)
kirbyedy
@kirbyedy
Feb 29 2016 10:54
did you see your console log ?
Uncaught TypeError: Cannot read property 'city' of undefined
Ngoc Chi Vo
@nchivo101
Feb 29 2016 10:55
@gordondavidescu you should try to use console log, it will help you tracking the problem :D
anthonygallina1
@anthonygallina1
Feb 29 2016 10:56
@kirbyedy yup and there are a few places in the code that say = LIke var location =
kirbyedy
@kirbyedy
Feb 29 2016 10:56
also dont know about that api.wunderground.com never heard of it
Gordon Davidescu
@gordondavidescu
Feb 29 2016 10:58
I did see console log
that's the problem
wunderground is fabulous
it actually gives you sample code based on a fixed city and state -- and that works great
but as soon as you swap out the api call using city and state and substitute the api call using lat and long, ERRRR
Claire Walker
@kjarva
Feb 29 2016 10:59
wow just finished my tribute page and hit the porfolio page challenge. My mind is blown, not sure where to even begin with parallax scrolling so going to go look at some tutorials and read documentation of anything I find related to it
anthonygallina1
@anthonygallina1
Feb 29 2016 10:59
@gordondavidescu do you need a key? http://www.wunderground.com/weather/api
Gordon Davidescu
@gordondavidescu
Feb 29 2016 10:59
when I used the open weather api yesterday it was throwing 404 errors, that's why I switched
I have a key
I straight up signed for an account just for this challenge, believe it :)
anthonygallina1
@anthonygallina1
Feb 29 2016 11:00
@gordondavidescu I just asked because I dont see it in the java script
kirbyedy
@kirbyedy
Feb 29 2016 11:00
@kjarva :thumbsup:
Gordon Davidescu
@gordondavidescu
Feb 29 2016 11:00
:O
Omar Adulbaki Alsarbaji
@omar-sh
Feb 29 2016 11:00
@kjarva it's not parallax
Claire Walker
@kjarva
Feb 29 2016 11:00
no?
Gordon Davidescu
@gordondavidescu
Feb 29 2016 11:00
251cfd518ea627fd
anthonygallina1
@anthonygallina1
Feb 29 2016 11:00
@gordondavidescu May be problematic
Omar Adulbaki Alsarbaji
@omar-sh
Feb 29 2016 11:00
the parallax is more complicated
Gordon Davidescu
@gordondavidescu
Feb 29 2016 11:01
that's my key
Omar Adulbaki Alsarbaji
@omar-sh
Feb 29 2016 11:01
and has more effect
Claire Walker
@kjarva
Feb 29 2016 11:01
ah, I thought that type of page scroll was parallax - so am I overcomplicating it then?
Gordon Davidescu
@gordondavidescu
Feb 29 2016 11:01
we shall chat later -- thanks all so far :)
kirbyedy
@kirbyedy
Feb 29 2016 11:01
@kjarva honestly,I would skip it for the moment
just use 2-3 nice background images and its fine
anthonygallina1
@anthonygallina1
Feb 29 2016 11:02
@gordondavidescu k see the jason now
Claire Walker
@kjarva
Feb 29 2016 11:03
well I was thinking of possibly skipping it for now anyway - pretty much everyones examples I've seen uses javascript and things I've not learned yet. I might give it a good try and if I just can't get it, come back to it once I know more
anthonygallina1
@anthonygallina1
Feb 29 2016 11:04
@gordondavidescu you stillon you may want to delete the post with your key in it
Was it some thing I said?
kirbyedy
@kirbyedy
Feb 29 2016 11:10
@kjarva mine doesnt :)
Claire Walker
@kjarva
Feb 29 2016 11:14
oh that's good then! my tribute page looks crap compared to everyone elses I've seen lol
Chethan Bhat
@chethanbhat
Feb 29 2016 11:20
i am stuck on twitch tv challenge
do we have to make multiple api calls?
i get results from api. but they are messed up and not in order when used in html
@kjarva use background-attachment : fixed to get the parralax effect
Ali Muhammad
@Ali-Elsbaee
Feb 29 2016 11:35
@HMAN1911 choose O instead of X
Arend Groot Bleumink
@arendgb
Feb 29 2016 12:16
   $(".target: nth-child(2)").addClass=("animated bounce");
  });

The task is

The second element in your target elements should bounce

What did I do wrong?

Robert Richey
@0x0936
Feb 29 2016 12:30
@AliMuhammed awesome! I lost more times than I care to admit - really well done :+1: :)
Robert Richey
@0x0936
Feb 29 2016 12:38
@arendgb two problems I see: cannot have a space between colon and pseudo class. $(".target:nth-child(2)") and remove the equals sign = after .addClass().
Jessica Taylor
@jessicatee
Feb 29 2016 13:38
hey, I have got to the random quote challenge and am struggling to find an api to use :/
i found theysaidso.com but I think it costs money, are there any free ones?
Alexander
@DurableMicron
Feb 29 2016 13:41
@jessicatee i just put in my own quotes into an array but the requirements may have changed since then
anyone know how to centre the search bar on this?
Jessica Taylor
@jessicatee
Feb 29 2016 13:44
make the width of the parent div 100% and then do margin: 0 auto; on the input?
Coira Ellison
@Coira
Feb 29 2016 13:45
@jessicatee i used http://forismatic.com/en/
Rahmat Subekti
@rmsubekti
Feb 29 2016 13:58
trouble returning json object from function, anyone know how to solve this?
function getLocation(){
  $.getJSON("http://ip-api.com/json",function(data){
    return data;
  });
}
Claire Walker
@kjarva
Feb 29 2016 13:58
thanks @chethanbhat - I missed your message until now!
CamperBot
@camperbot
Feb 29 2016 13:58
kjarva sends brownie points to @chethanbhat :sparkles: :thumbsup: :sparkles:
:star: 315 | @chethanbhat | http://www.freecodecamp.com/chethanbhat
Coira Ellison
@Coira
Feb 29 2016 14:00
@rmsubekti you can't return, as getJson is an asynchronous function, you'll need to use data inside the function(data) {function
genesisjoec
@genesisjoec
Feb 29 2016 14:00
I'm wonderin my I'm not getting a success with when I click my button to query the api?
$("button").click(function(){
$.get("http://api.openweathermap.org/data/2.5/weather?q=London&appid=51f674f3e44cbe958936a74cab24252f",function(data,status){
alert("Data: " + data + "\nStatus: " + status);
    });
});
Coira Ellison
@Coira
Feb 29 2016 14:03
@genesisjoec that should work, do you have a codepen?
Jessica Taylor
@jessicatee
Feb 29 2016 14:05
So i'm using the code below to try and get a quote from forismatic but i'm getting an error when I click my #getMessage button : XMLHttpRequest cannot load http://api.forismatic.com/api/1.0/method=getQuote&format=json&lang=en. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
$("#getMessage").on("click", function(){
      // Only change code below this line.
      $(".message").empty();
      $.getJSON("http://api.forismatic.com/api/1.0/method=getQuote&format=json&lang=en", function(json){
        $(".message").html(JSON.stringify(json));
      });


      // Only change code above this line.
    });
Rahmat Subekti
@rmsubekti
Feb 29 2016 14:06
thanks for your advice @Coira, i think, i can use that way.
CamperBot
@camperbot
Feb 29 2016 14:06
rmsubekti sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 495 | @coira | http://www.freecodecamp.com/coira
Jessica Taylor
@jessicatee
Feb 29 2016 14:07
I feel like the whole JSON API's and AJAX section is a little light for the content it trys to teach lol
Coira Ellison
@Coira
Feb 29 2016 14:07
@jessicatee you'll need to use jsonp format, something like jsonp: jsonp, dataType: "jsonp" (that might not be entirely correct, but something along those lines)
Giacomo
@Jack1618
Feb 29 2016 14:08
I feel like the whole JSON API's and AJAX section is a little light for the content it trys to teach lol
yes it is
Coira Ellison
@Coira
Feb 29 2016 14:08
oh yeah, i just googled a lot
genesisjoec
@genesisjoec
Feb 29 2016 14:08
Yes @Coira
Giacomo
@Jack1618
Feb 29 2016 14:08
I’m stuck to the Wikipedia viewer. I don’t know where to start. :/
genesisjoec
@genesisjoec
Feb 29 2016 14:08
@Coira I messaged you.
Coira Ellison
@Coira
Feb 29 2016 14:09
got it, just looking now :)
Hemang Kumar
@hemangsk
Feb 29 2016 14:21
@jessicatee That CORS error usually gets resolved by adding a "&callback=?" in the end of api call url

@Jack1618 try making an input field, put a search button .. html,css things
Make an function.. attach it to the button using jquery...
Then you can work on this -> https://www.mediawiki.org/wiki/API

we know what the zipline is asking.. right.. it basically requires us to make a article list viewer... so that means you have to your program should ask for data from wikipedia.. then show it in your html page.. that asking thing is going to be done using APIs

Giacomo
@Jack1618
Feb 29 2016 14:27
@hemangsk thank’s, I’ll try! I’m reading the APIs documentation!
CamperBot
@camperbot
Feb 29 2016 14:27
jack1618 sends brownie points to @hemangsk :sparkles: :thumbsup: :sparkles:
:star: 318 | @hemangsk | http://www.freecodecamp.com/hemangsk
Hemang Kumar
@hemangsk
Feb 29 2016 14:28
@Jack1618 np :)
vichus1995
@vichus1995
Feb 29 2016 14:40
i am currently doing the weather app and i want to know whether it is possible to know all the possible values of the weather.main variable in the api response,so that i can change the background image accordingly.
Coira Ellison
@Coira
Feb 29 2016 14:43
@vichus1995 are you using openweather? i used the weather condition codes from this list http://openweathermap.org/weather-conditions
Owen from Canada
@owenfromcanada
Feb 29 2016 14:47
@Jack1618 Personally, I found the API documentation fairly confusing for mediawiki. Technically, it's all there, but the language they use around queries, lists, etc, can be fairly confusing. In the end, I found that experimenting with the URI first, then referencing the documentation when I had questions, was a more useful approach (in this particular case).
vichus1995
@vichus1995
Feb 29 2016 14:48
thanks @Coira
CamperBot
@camperbot
Feb 29 2016 14:48
vichus1995 sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 496 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Feb 29 2016 14:49
np
:)
genesisjoec
@genesisjoec
Feb 29 2016 14:49
@Coira I messaged you again.
@Coira Thanks for the earlier help.
CamperBot
@camperbot
Feb 29 2016 14:50
genesisjoec sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 497 | @coira | http://www.freecodecamp.com/coira
Gordon Davidescu
@gordondavidescu
Feb 29 2016 15:08
hi all
check it out
i have two beautiful global variables. thecity and thestate
yes, I need to rename them.
as long as I refer to them inside the function "requestPosition" they output something
as soon as I'm outside? nada
see console log for example
J Player
@Heyjp
Feb 29 2016 15:11
Has anyone got any tips for creating the ai for tic tac toe?
Gordon Davidescu
@gordondavidescu
Feb 29 2016 15:12
I do
I started by checking if the player has anything two in a row
because in that case, block that sucka
if the player doesn't have anything two in a row, and the computer hasn't moved yet, go for a random open space
if the player doesn't have anything two in a row and the computer has moved, try to make the next computer move adjacent to the first move
you can look at my code for an example of the checking if the player has two in a row
AlbertoRFer
@AlbertoRFer
Feb 29 2016 15:16
hi people i'm working on the weather app. i'm using ajax and jsonp but i still can't get the data
Gordon Davidescu
@gordondavidescu
Feb 29 2016 15:17
I'm struggling with that as well @AlbertoRFer
for the last two days
AlbertoRFer
@AlbertoRFer
Feb 29 2016 15:18
:smile:
Owen from Canada
@owenfromcanada
Feb 29 2016 15:18

@gordondavidescu try initializing your global variables to "foo" or similar. See what gets populated then.

It's not that they're not being output, but as soon as you call your function:
navigator.geolocation.getCurrentPosition(function(position){ ... });

Gordon Davidescu
@gordondavidescu
Feb 29 2016 15:18
When I initialize them to foo, that's what gets thrown out
Owen from Canada
@owenfromcanada
Feb 29 2016 15:19
that function won't be executed right away - whereas the rest of your $(document).ready function will continue to execute
Gordon Davidescu
@gordondavidescu
Feb 29 2016 15:19
ah
Owen from Canada
@owenfromcanada
Feb 29 2016 15:20
so in theory, if you put some sort of delay after you execute requestPosition();, your output would look different
Lanitta
@DivaWeb
Feb 29 2016 15:20
good morning all
Owen from Canada
@owenfromcanada
Feb 29 2016 15:20
but you're better to populate the html elements as part of the getCurrentPosition(function...) function
Samuel Jones
@samjcs
Feb 29 2016 15:21
Hello world
CamperBot
@camperbot
Feb 29 2016 15:21

welcome to FreeCodeCamp @samjcs!

Gordon Davidescu
@gordondavidescu
Feb 29 2016 15:21
which would be great except I have a huge honker of a function that uses the city and state data below it
it may be time to burn down the entire document and start over from scratch, again. perhaps invest some time looking at dark sky api as wunderground has been less than wunderful
:)
Owen from Canada
@owenfromcanada
Feb 29 2016 15:24
@gordondavidescu Yeah, and you probably want to divide it up for simplicity and clarity - awesome! What I'd probably do is put all of that code inside another function, and pass that function as an argument to requestPosition() - i.e. requestPosition(onSuccess) - that way the remaining huge function won't be executed until requestPosition is done with its thing, and you still get to divide up your code. Does that make sense?
Gordon Davidescu
@gordondavidescu
Feb 29 2016 15:24
It does.
thanks @owentosh
CamperBot
@camperbot
Feb 29 2016 15:24
gordondavidescu sends brownie points to @owentosh :sparkles: :thumbsup: :sparkles:
:star: 311 | @owentosh | http://www.freecodecamp.com/owentosh
Gordon Davidescu
@gordondavidescu
Feb 29 2016 15:25
did you try my trick @Heyjp
@owentosh anything interesting in Saginaw?
Sean
@burritoranch
Feb 29 2016 15:29
In the example for the Personal Portfolio Webpage project, does anyone know how to scroll through the pages without having the back images move? I don't remember it being covered in the training. Thanks!
Owen from Canada
@owenfromcanada
Feb 29 2016 15:29
@gordondavidescu only the strange, strange weather. Ended up working well when I was testing my weather app, though.
Gordon Davidescu
@gordondavidescu
Feb 29 2016 15:30
That's good.
Owen from Canada
@owenfromcanada
Feb 29 2016 15:30
Gordon Davidescu
@gordondavidescu
Feb 29 2016 15:32
I wonder how many people google let me google that for you, and then link it with a let me google that for you link for people who ask how to get to let me google that for you. and also wonder if perchance would you care for me to bing that for you is available :P
be back later. thanks again @owentosh
CamperBot
@camperbot
Feb 29 2016 15:32
gordondavidescu sends brownie points to @owentosh :sparkles: :thumbsup: :sparkles:
:warning: gordondavidescu already gave owentosh points
Sean
@burritoranch
Feb 29 2016 15:32
@owentosh Looks like it is the background-attachment property. Thanks!
CamperBot
@camperbot
Feb 29 2016 15:32
burritoranch sends brownie points to @owentosh :sparkles: :thumbsup: :sparkles:
:star: 312 | @owentosh | http://www.freecodecamp.com/owentosh
Pedro Figueiredo
@pedronfigueiredo
Feb 29 2016 15:44
Hi
help pairwise
CamperBot
@camperbot
Feb 29 2016 15:44

:point_right: algorithm pairwise [wiki]

Explanation:

The program should look for the numbers in the array which would add to make the number from the arg. Then instead of adding those numbers up, you will add their indices which is the reason why you get 11 on the example from detail.

Remember that arrays start at index 0 and go from there so from [1,4,2,3,0,5] if we switch to their indices it would be [0,1,2,3,4,5] then we add indices 1 + 2 + 3 + 5 and we get 11. That is what we need to return.

:pencil: read more about algorithm pairwise on the FCC Wiki

Lanitta
@DivaWeb
Feb 29 2016 15:53
hey guys I am feeling a little dumb this morning lololol
I am not sure if I am overthinking this or I am completely missing something but I have 2 days trying see what I am missing lol

var count = 0;

function cc(card) {
// Onl change code below this line
var Bet;
var Hold;

switch(card){
case 2:
case 3:
case 4:
case 5:
case 6:

if(card >= 2 || card <= 6){
  count = card++;
  return count + " Bet";

}
break;

case 7:
case 8:
case 9:

 break;

case 10:
case "J":
case "Q":
case "K":
case "A":

 break;

}

// Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2,3,5,4); cc(3); cc(7); cc('K'); cc(2,3,4,5,6);

This is for the counting card lesson in javascript
Coira Ellison
@Coira
Feb 29 2016 15:57
hey @DivaWeb you're not using switch correctly
you don't need to put an if statement inside of switch
also this line count = card++; i'm not sure what you're doing here?
Lanitta
@DivaWeb
Feb 29 2016 16:00
@Coira so I am not sure what you talking about
@Coira I did so much research and the code in practice is right
@Coira please explain to me more detailed what you are talking about.
Coira Ellison
@Coira
Feb 29 2016 16:01
the switch statement acts like an if statement, so this part here if(card >= 2 || card <= 6){ is redundant
you can do it like this
case 6:
  count++;
  break;
Lanitta
@DivaWeb
Feb 29 2016 16:02
@Coira yes I agree but that does not work
Coira Ellison
@Coira
Feb 29 2016 16:03
do you understand about switch case fallthrough?. e.g. do you know why there's only 1 break here?
case 2:
case 3:
case 4:
case 5:
case 6:
  count++;
  break;
Lanitta
@DivaWeb
Feb 29 2016 16:03
@Coira yes as you can see I have it all typed out
Coira Ellison
@Coira
Feb 29 2016 16:03
you'll need an if statement outside the switch, which returns count + some string
Lanitta
@DivaWeb
Feb 29 2016 16:05
@Coira so according to what we were taught in switch lessons we put what we want to happen within the case section
@Coira So you are telling me that we write all of what we want done outside of our switchs
Coira Ellison
@Coira
Feb 29 2016 16:06
inside the switch you want to modify count depending on the card
but once the switch is done, you'll need an extra if to return some value
Lanitta
@DivaWeb
Feb 29 2016 16:08
@Coira I find this section very incomplete about all the info you need because all the research I did showed it within in the switch.
Coira Ellison
@Coira
Feb 29 2016 16:10
i haven't been through the switch waypoints so i'm not sure what it says, but i think the instructions for this one is quite long and involved
Lanitta
@DivaWeb
Feb 29 2016 16:10
@Coira yes if you have been taught all of the resources before hand it would be a breeze.
Coira Ellison
@Coira
Feb 29 2016 16:11
you don't have to put everything inside switch, it's just a more concise way of writing if else statements
@DivaWeb got an idea on how to proceed, or need another hint?
Lanitta
@DivaWeb
Feb 29 2016 16:15
@Coira to be honest I hear what you say but I have to see any example included with the lessons they give here that show that so I will get it figured out.
Coira Ellison
@Coira
Feb 29 2016 16:16
@DivaWeb i can give you some example code if you wish?
Lanitta
@DivaWeb
Feb 29 2016 16:17
@Coira that would be great or even if you have an article that explains more detailed how to use the switch statements
@Coira I am one of those people that can't just be told I have to know why lol
Stefan
@st3fun1
Feb 29 2016 16:35
Hi guys, i'm looking for an ideea to refactor this function
function titleCase(str) {
  var array = str.toLowerCase().split(" ");
  for(var i = 0; i<array.length;i++){
     array[i] = array[i].charAt(0).toUpperCase() + array[i].substr(1);     
  }
      return (str = array.join(" "));   
}

titleCase("I'm a little tea pot");
Matt Green
@mattxgreen
Feb 29 2016 16:39
@st3fun1 so you're uppercasing the first letter of every word?
AND lowercasing everything else
innoprog
@innoprog
Feb 29 2016 16:40
Hello all! I wonder if someone could take a look at my portfolio page and see if you can recreate the problem I'm having. Don't know if it's in the CSS or JS
Matt Green
@mattxgreen
Feb 29 2016 16:41
@innoprog What's the prob?
Stefan
@st3fun1
Feb 29 2016 16:42
@mattxgreen yeah
i just want a less code way to do it
i ve seen people with just 1 line
for that problem
Claire Walker
@kjarva
Feb 29 2016 16:43
It looks great by the way ;)
innoprog
@innoprog
Feb 29 2016 16:43
@mattxgreen Hi, thanks for responding. When I click the "home" link, the first heading goes up behind the nav, but if I click the link again, the page moves down, then up and down repeatedly
CamperBot
@camperbot
Feb 29 2016 16:43
innoprog sends brownie points to @mattxgreen :sparkles: :thumbsup: :sparkles:
Karl Jahn
@kajahno
Feb 29 2016 16:43
What's the name of that challenge?
CamperBot
@camperbot
Feb 29 2016 16:43
:star: 53 | @mattxgreen | http://www.freecodecamp.com/mattxgreen
Karl Jahn
@kajahno
Feb 29 2016 16:43
@st3fun1
innoprog
@innoprog
Feb 29 2016 16:44
Seems to only happen with the "home" link... just moves the page up and down. It could be an issue in targeting the anchor, the CSS... not sure.
Matt Green
@mattxgreen
Feb 29 2016 16:44
@st3fun1 You could look at a regex solution
str.replace()
Stefan
@st3fun1
Feb 29 2016 16:44
title case a sentence; the code is ok
but i want a faster way
Matt Green
@mattxgreen
Feb 29 2016 16:44
@innoprog checking
Stefan
@st3fun1
Feb 29 2016 16:45
thank @mattxgreen
CamperBot
@camperbot
Feb 29 2016 16:45
st3fun1 sends brownie points to @mattxgreen :sparkles: :thumbsup: :sparkles:
:star: 54 | @mattxgreen | http://www.freecodecamp.com/mattxgreen
Stefan
@st3fun1
Feb 29 2016 16:45
thanks
Matt Green
@mattxgreen
Feb 29 2016 16:45
@innoprog I get same behavior
innoprog
@innoprog
Feb 29 2016 16:46
It's strange, isn't it.. I'm just learning to create this single-page, anchor-reliant design thing that everyone seems to love, just trying to do it myself without copying code just yet.
Okay, well at least it's not just me. Happens on all viewport sizes, and when scrolled to any position on the page. Thank you for checking it out, I'll keep hacking at it
Matt Green
@mattxgreen
Feb 29 2016 16:49
@innoprog It looks like it's due to the fact that navbar is hidden when the anchor is pressed, so it goes to the "right" place, then the navbar covers it up
kirbyedy
@kirbyedy
Feb 29 2016 16:49
@innoprog i would add top padding on that div and push it more down
Jessica Taylor
@jessicatee
Feb 29 2016 16:52
give the div that you are targeting an id, for example home, and then the #home href will target the div rather than an empy anchor tag
alex chirila
@al3xoi
Feb 29 2016 16:57
Can anyone please tell me what am I doing wrong here?
var cashAvailable = [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]].reduce(function(a, b) {
  return (a[1] + b[1]).toFixed(5);

  });
Jessica Taylor
@jessicatee
Feb 29 2016 16:58
what are you trying to do?
what challenge I mean :)
alex chirila
@al3xoi
Feb 29 2016 16:59
im trying to add those second element values from each sub array
1.01 + 2.05 + 3.10 an so on
Exact Change
Jessica Taylor
@jessicatee
Feb 29 2016 17:05
is this linked to a challenge though because I would just loop through the cash available array
alex chirila
@al3xoi
Feb 29 2016 17:07
its not necessarely linked, just used reduce in the previous challenge, and thought using reduce again would mean less code.
I will use a regular for loop i guess
Loren Baca
@vbroskas
Feb 29 2016 17:08

guys, what is the basic routine with using images for backgrounds at a beginner level? I'm trying to use a couple images as backgrounds on the portfolio project. I've been using http://postimg.org/ to upload images I plan to use

How should i be re-sizing them if I plan to use them on a website? I've tried many different ways (including keeping original size) but when I add them to my page, they are always off-center, or a little too long, etc. Even if Im using center-block

Jessica Taylor
@jessicatee
Feb 29 2016 17:10
@al3xoi i'm not that far yet but I would create a getTotalCashDrawer function and call that whenever I wanted to check it
Owen from Canada
@owenfromcanada
Feb 29 2016 17:15

@vbroskas I don't know that there's a particular size that is appropriate. Usually when you use an image, you'll want to set the size explicitly, often with a percentage (width: 100% is very common). This way, no matter the resolution of the image, you'll know what size it ends up as on your page.

I'd resize or change the image such that the file size is appropriate. You can use more advanced image editors like gimp to change quality on jpg images, for instance. Ultimately, the file size that is acceptable depends on the application, but if you can get it lower than 1MB, that will generally work well (though I'm not an authority on the matter).

Tommy
@Saintgein
Feb 29 2016 17:15
Anyone knows why # links don't work on codepen? Hamburger menu on mobile size and the portfolio modals don't work there..
http://codepen.io/Saintgein/pen/ONJLWG
innoprog
@innoprog
Feb 29 2016 17:16
@mattxgreen @kirbyedy Thanks for the input, guys. Sorry had to run around the corner real quick.
Yeah, the padding-top works but then every other click pushes even further down than it should be ... hmm
CamperBot
@camperbot
Feb 29 2016 17:16
innoprog sends brownie points to @mattxgreen and @kirbyedy :sparkles: :thumbsup: :sparkles:
:warning: innoprog already gave mattxgreen points
:star: 573 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
alex chirila
@al3xoi
Feb 29 2016 17:16
@jessicatee i just made it like this, I'll see, if I need to call that value more than once I'll put it in a function
for (var i=0; i<cid.length; i++) {
    total += cid[i][1];
  }
innoprog
@innoprog
Feb 29 2016 17:16
@vbroskas Are you trying to create a main/ body background image or a DIV background image?
Matt Green
@mattxgreen
Feb 29 2016 17:17
@st3fun1 get that regex working?
kirbyedy
@kirbyedy
Feb 29 2016 17:17
give the div that you are targeting an id, for example home, and then the #home href will target the div rather than an empy anchor tag <-- try also this what jessica said
Loren Baca
@vbroskas
Feb 29 2016 17:17
@owenfromcanada ok so when I upload the images try to keep them as large/highest quality as possible while keeping them around 1MB. And then when I link to the image on my page scale the size down if needed?
@innoprog man its kinda all over the place right now. I put a bunch of my stuff in a jumbotron, so I'm trying to figure out how to layer a different background image for each section as the user scrolls down
I can link my codepen for what I have right now, without any images put in
innoprog
@innoprog
Feb 29 2016 17:18
Yeah, do that!
Also feel free to PM or DM or whatever they call it here... CP? lol
Fabricio Leal
@pharaohlxvi
Feb 29 2016 17:20
Hy guys, wondering if any of you could give me a hand. I'm working on "Build a Random Quote Machine". I've done the quote thing, added a button that randomly changes the quote displayed. That's all fine. My problem is adding the tweet button. I managed to add a default blue button that tweets the website URL, and not the quote shown. I have looked around and have tried a few ideas, but so far haven't managed to do it. Any ideas you guys could share with me? Thanks a lot.
Owen from Canada
@owenfromcanada
Feb 29 2016 17:25
@vbroskas Yes - you'll want to make sure the image resolution is appropriate for the largest application (eg. 1920x1080 widescreen monitor), then scale it in the CSS to make it look appropriate at all page sizes. In theory, if you wanted to really optimize things for mobile devices, there might be a way to have a smaller resolution image that would reduce the data requirement for things like mobile devices, but that gets beyond the beginner level.
@pharaohlxvi <hint>Can you use jQuery to edit the attributes of the link (a) element around the twitter button? What attributes might you want to edit, and when?</hint>
Loren Baca
@vbroskas
Feb 29 2016 17:26
@owenfromcanada ok cool, thanks for clarifying that!
CamperBot
@camperbot
Feb 29 2016 17:26
vbroskas sends brownie points to @owenfromcanada :sparkles: :thumbsup: :sparkles:
:star: 315 | @owenfromcanada | http://www.freecodecamp.com/owenfromcanada
Jeremy Roe
@jeremyroe
Feb 29 2016 17:27
Has anyone here successfully used typeahead.js on codepen?
Fabricio Leal
@pharaohlxvi
Feb 29 2016 17:30
@owenfromcanada That's the thing. The button I have is the one supplied by Twitter and it has a script tag in the HTML file. The content of this script tag doesn't make too much sense for me. I'm not really sure what I should change. Or are you suggesting I should scrap this script tag and create a new one from scratch in my js file?
Owen from Canada
@owenfromcanada
Feb 29 2016 17:35

Now we're talking. And are you sure you need a JS handler for it? In the example provided by FCC, what do you see when you mouse over the twitter button?

Or are you suggesting I should scrap this script tag and create a new one from scratch in my js file?

Fabricio Leal
@pharaohlxvi
Feb 29 2016 17:40
@owenfromcanada It gets lighter.
Owen from Canada
@owenfromcanada
Feb 29 2016 17:40
@pharaohlxvi Check the status bar ;)
Fabricio Leal
@pharaohlxvi
Feb 29 2016 17:43
@owenfromcanada Right, the status bar shows how the final link would be and it has the quote itself in it. I'm guessing I would have to construct the link by concatenating the parts that don't change with the variable that holds the current quote, am I right? All that in the JS file, right?
Sultan Ahmed
@sultanshaik
Feb 29 2016 17:44
Hi, I have created a tribute page
I face an issue in the centering of the list elements
Can someone please help me?
Chris Dinant
@chrisdinant
Feb 29 2016 17:47
hi guys, I'm just starting with the weather app, I'm trying to use pretty weather icons from Skycon. Can one of you tell me why they seem to work in firefox but not in chrome? http://codepen.io/chrisdinant/pen/JXoGqK
Fabricio Leal
@pharaohlxvi
Feb 29 2016 17:47
@sultanshaik I would use text-center only for the title. And have it as h2, h3, or something like that.
Sultan Ahmed
@sultanshaik
Feb 29 2016 17:48
@pharaohlxvi What about the list elements?
Owen from Canada
@owenfromcanada
Feb 29 2016 17:48
@pharaohlxvi Yeah, that's pretty much it. Check out the twitter api docs for more info.
Sultan Ahmed
@sultanshaik
Feb 29 2016 17:48
I am trying to achieve this http://codepen.io/FreeCodeCamp/full/wMQrXV
Brian
@sludge256
Feb 29 2016 17:49
@chrisdinant this i the error I get
Refused to execute script from 'https://raw.githubusercontent.com/darkskyapp/skycons/master/skycons.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.
pen.js:11 Uncaught ReferenceError: Skycons is not defined
JD Tadlock
@jdtdesigns
Feb 29 2016 17:50
@sultanshaik You can use bootstrap text-center class for the paragraph. The list items just needed the list-style set to 'none' http://codepen.io/jdtadlock/pen/vGEKKP?editors=1100
Fabricio Leal
@pharaohlxvi
Feb 29 2016 17:50
@sultanshaik You could add some margin to the li if you wanted. But don't forget to close the wrapper around the title, or the text-center will be valid for the li as well.
Owen from Canada
@owenfromcanada
Feb 29 2016 17:50
@sultanshaik If you set the text to center, then the bullet points won't line up with each other. This can only be done if you align the text left. But that doesn't mean you can't wrap it in another div and center that div inside the container.
Sultan Ahmed
@sultanshaik
Feb 29 2016 17:51
@pharaohlxvi @owenfromcanada Thank you friends
CamperBot
@camperbot
Feb 29 2016 17:51
sultanshaik sends brownie points to @pharaohlxvi and @owenfromcanada :sparkles: :thumbsup: :sparkles:
:star: 369 | @pharaohlxvi | http://www.freecodecamp.com/pharaohlxvi
:star: 317 | @owenfromcanada | http://www.freecodecamp.com/owenfromcanada
Sultan Ahmed
@sultanshaik
Feb 29 2016 17:51
That helped
Chris Dinant
@chrisdinant
Feb 29 2016 17:51
thanks @sludge256 I could have checked that myself!
CamperBot
@camperbot
Feb 29 2016 17:51
chrisdinant sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
JD Tadlock
@jdtdesigns
Feb 29 2016 17:51
@sultanshaik you also had some padding set on the ul which i removed
CamperBot
@camperbot
Feb 29 2016 17:51
:star: 1708 | @sludge256 | http://www.freecodecamp.com/sludge256
Fabricio Leal
@pharaohlxvi
Feb 29 2016 17:51
You're welcome.
Chris Dinant
@chrisdinant
Feb 29 2016 17:52
@sludge256 Let's see if I can un'strict' it somehow.
Fabricio Leal
@pharaohlxvi
Feb 29 2016 17:52
Thanks @owenfromcanada for your help.
CamperBot
@camperbot
Feb 29 2016 17:52
pharaohlxvi sends brownie points to @owenfromcanada :sparkles: :thumbsup: :sparkles:
:star: 318 | @owenfromcanada | http://www.freecodecamp.com/owenfromcanada
Brian
@sludge256
Feb 29 2016 17:52
@chrisdinant where did you get your rawgit link from?
Chris Dinant
@chrisdinant
Feb 29 2016 17:53
Brian
@sludge256
Feb 29 2016 17:53
@chrisdinant A fresh rawgit link from the Skycons repo seems to work fine for me
oh you're using a different method to link it
I see
I thought you were using rawgit at first
Chris Dinant
@chrisdinant
Feb 29 2016 17:55
@sludge256 I see!, yeah this is my first steps with Github, I couldn't find a good way to find the link to the file
bulbrain
@bulbrain
Feb 29 2016 17:56
anyone else thinks that the wheater app is way too hard? or I am stupid :D
Brian
@sludge256
Feb 29 2016 17:56
rawgit.com can serve up files from Github similar to a CDN
kind of link when you link to Bootstrap or jQuery
Bruce Young
@mutantspore
Feb 29 2016 17:56
@bulbrain lol what’s the issue
bulbrain
@bulbrain
Feb 29 2016 17:57
I mean I dont know anything about apis and angular :(
Bruce Young
@mutantspore
Feb 29 2016 17:57
@bulbrain ok you don’t need angular and are not expected to use it
Chris Dinant
@chrisdinant
Feb 29 2016 17:58
@sludge256 Can I find this rawgit link on the github page I linked above?
Bruce Young
@mutantspore
Feb 29 2016 17:58
you did “some” api work in FCC?
@bulbrain FCC doesn’t even teach Angular anymore
bulbrain
@bulbrain
Feb 29 2016 17:59
but how can I call the openwheaterapi withount angular?
Bruce Young
@mutantspore
Feb 29 2016 17:59
jQuery
Chris Dinant
@chrisdinant
Feb 29 2016 17:59
@sludge256 Just checking out rawgit, I'll find it, thanks @sludge256
CamperBot
@camperbot
Feb 29 2016 17:59
chrisdinant sends brownie points to @sludge256 and @sludge256 :sparkles: :thumbsup: :sparkles:
:warning: chrisdinant already gave sludge256 points
:warning: chrisdinant already gave sludge256 points
Brian
@sludge256
Feb 29 2016 18:00
@chrisdinant You can visit the rawgit page then just post in urls to github files there
It's kind of a 3rd party service for the lack of a better term
Bruce Young
@mutantspore
Feb 29 2016 18:00
you have done or could look up more on $.getJSON or $.ajax
Brian
@sludge256
Feb 29 2016 18:01
@chrisdinant I wasn't able to find the link you used on the repo
bulbrain
@bulbrain
Feb 29 2016 18:02
ok thanks @mutantspore ill try it
CamperBot
@camperbot
Feb 29 2016 18:02
bulbrain sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1184 | @mutantspore | http://www.freecodecamp.com/mutantspore
bulbrain
@bulbrain
Feb 29 2016 18:02
soo its not that hard its simply me being stupid :D
Bruce Young
@mutantspore
Feb 29 2016 18:03
@bulbrain ummm. no comment … but yes.. it’s not hard to do the basic weather app. You can make it harder with different icons, picture backgrounds etc if you like :)
JD Tadlock
@jdtdesigns
Feb 29 2016 18:04
@sultanshaik I didn't look at your code before. After skimming over it, I found some errors such as a ul nested inside a paragraph. I would replace that with an h3 and also use the div wrapping that section to style the elements how you like. http://codepen.io/jdtadlock/full/vGEKKP/
bulbrain
@bulbrain
Feb 29 2016 18:05
it needs a hint: use jquery $.getJSON or $.ajax dont waste 2 days trying to do it with angular :)
Bruce Young
@mutantspore
Feb 29 2016 18:07
well there were lessons on getJSON .. was there any mention of angular at all? perhaps the person who wrote the example used angular. FCC did teach it for a while (I did the lessons) but now they are teaching React instead. Just JS and some jQuery will get you though. The basic minimalist app is not that complicated.
of course making it “cool” may take more effort
tommy
@tommygebru
Feb 29 2016 18:12
help with bootstrap anyone?
CamperBot
@camperbot
Feb 29 2016 18:12
no wiki entry for: with bootstrap anyone
Bruce Young
@mutantspore
Feb 29 2016 18:12
@bulbrain ok here is a one word major hint … ”asynchronous”
and you’ll need to get an API key from open Weather Map (free)
tommy
@tommygebru
Feb 29 2016 18:13
bootstrap: how to position text...
but in a carousel...
http://codepen.io/gebrutommy/pen/VaYeVP?editors=1000
i want the text to be on top of the image not underneath it :smile:
bulbrain
@bulbrain
Feb 29 2016 18:14
what do you mean? how I get a key?
I need to make a request first for a key or something?
Bruce Young
@mutantspore
Feb 29 2016 18:15
@bulbrain go to the openweather map site , you’ll need to anyway to understand the api docs
Amir Ghafouri
@amirghafouri
Feb 29 2016 18:18

hey @mutantspore can you look at my HTML here, specifically the div with id #streamers : http://codepen.io/amirghafouri/pen/ONJZoZ?editors=1100

I want the image in each row (.streamer) to sit next to all the information. I thought I could do this by making the img display:inline-block and then wrapping the h4 and two p elements in a div called .streamerInfo and giving that display: inline-block, but when I do that it makes the img element all wonky within the row

bulbrain
@bulbrain
Feb 29 2016 18:19
yeah i readed it but i thought i just need to call api.openweathermap.org/data/2.5/weather?lat=35&lon=139 with ajax and the server will give me back the data witch I can access with the .success function
isnt it that way? :(
Matthew Hiller
@BossMatt101
Feb 29 2016 18:20
On my tribute page, I'm trying to create header with the main title and a small subtext to the right of it, in the same row, with both elements being centered together like it's one element, but I can't figure out how to do the centering besides just approximating with the column length
Bruce Young
@mutantspore
Feb 29 2016 18:20
@amirghafouri look at media objects in bootstrap. it’s designed to do exactly that.
http://getbootstrap.com/components/#media
Jeff
@adzam5
Feb 29 2016 18:21
@bulbrain as @mutantspore said, you need to sign up to get a free API key which you need to include in the URL of the JSON request
Bruce Young
@mutantspore
Feb 29 2016 18:21
@bulbrain that is close. you’ll need to actually put http:// on the front of the URL and you WILL need an api key. They used to allow it withought but for several months now it has been compulsory
bulbrain
@bulbrain
Feb 29 2016 18:22
ok thanks again ill do it
Jeff
@adzam5
Feb 29 2016 18:23
@bulbrain I would also include the full lat / lon to get a more precise location
bulbrain
@bulbrain
Feb 29 2016 18:23
yeah this is just an example ill use the navigator.geolocation
Jeremy
@JeremyAntonoff
Feb 29 2016 18:25
function bouncer(arr) {
  for (i=0;i<arr.length;i++)
    if (arr[i] === false) {
      arr = arr.filter([i]);
    }


  // Don't show a false ID to this bouncer.
  return arr;
}

bouncer([7, "ate", "", false, 9]);
can someone help me
Jeff
@adzam5
Feb 29 2016 18:27
@JToddFL you dont need to loop thru the array. Just create a function that filters out boolean
Bruce Young
@mutantspore
Feb 29 2016 18:28
@JToddFL yes refer to the instructions.. look up Array.filter()
@JToddFL the answer is one short line
or AN answer can be ...
Jeff
@adzam5
Feb 29 2016 18:35
@BossMatt101 Put your subtext in the same div, but in a different element. Look up Bootstrap headings
Also, if you want it centered you need to remove the text-left class
bulbrain
@bulbrain
Feb 29 2016 18:42
I made a request with $.ajax({url: url, success: function(result){
$("#test").html(result);
}}); and I get response i see it with firebug but it doesnt go to the div
Is that what you mean with asynchronous?
Bruce Young
@mutantspore
Feb 29 2016 18:43
yes. that word asynchronous comes back to haunt you. Can you show us your pen?
lol yes.
Bruce Young
@mutantspore
Feb 29 2016 18:44
the ajax call wil go off and come back when it’s good and ready. Your code however wil just run on and try to use stuff that’s not back yet
bulbrain
@bulbrain
Feb 29 2016 18:45
I know it is not supposed to be that way im just testing stuff
ok i get it
ill save it in a variable and use it when its done right ? :)
Bruce Young
@mutantspore
Feb 29 2016 18:46
just looking.. your’s should work.. give me a sec
Jeremy
@JeremyAntonoff
Feb 29 2016 18:47
@mutantspore why couldn't you sub in false for Boolean
Amir Ghafouri
@amirghafouri
Feb 29 2016 18:47
@mutantspore worked very well, thanks
CamperBot
@camperbot
Feb 29 2016 18:47
amirghafouri sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1185 | @mutantspore | http://www.freecodecamp.com/mutantspore
Bruce Young
@mutantspore
Feb 29 2016 18:48
@bulbrain ok your’s works just fine. the thing returned is an object and you can’t simply .html it to the page but it did return
@bulbrain so just access the elements of teh object with dot notation and you’ll be fine
@bulbrain if you add in console.log(result); you will see it in console
@amirghafouri great :)
@JToddFL how did you go? I can PM you the answer I have if you like but it’s too short to give hints about any more than I have.
bulbrain
@bulbrain
Feb 29 2016 18:53
ok thanks @mutantspore
CamperBot
@camperbot
Feb 29 2016 18:53
bulbrain sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: bulbrain already gave mutantspore points
Anthony
@AnthonyGraindorge
Feb 29 2016 18:55
@mutantspore @bulbrain I have the same problem but I don’t see the trick...
Can you help me ? :)
Bruce Young
@mutantspore
Feb 29 2016 18:56
@AnthonyGraindorge you need http:// in the front of your URL
@AnthonyGraindorge otherwise it’s treated a just a call to teh local file system
Anthony
@AnthonyGraindorge
Feb 29 2016 18:57
teh ?
Bruce Young
@mutantspore
Feb 29 2016 18:58
bad typing by me “the"
JD Tadlock
@jdtdesigns
Feb 29 2016 18:58
the*
Bruce Young
@mutantspore
Feb 29 2016 18:58
i do it all teh time
lol
After awhile helping on FCC you get to see trends… most common mistakes… and right up there in the top 10 is not putting http:// on a URL. I know browsers do it for you these days… perhaps that’s the reason people forget.
Anthony
@AnthonyGraindorge
Feb 29 2016 19:02
;) I just give the ‘http’ but it doesn’t work anymore
Bruce Young
@mutantspore
Feb 29 2016 19:03
This message was deleted
Matthew Hiller
@BossMatt101
Feb 29 2016 19:03
I'm having trouble creating a border on my header element, can anyone see why?
Bruce Young
@mutantspore
Feb 29 2016 19:03
a fork of @AnthonyGraindorge with just the http:// added
Jeremy
@JeremyAntonoff
Feb 29 2016 19:04
@mutantspore i got the answer i just dont understand why you cant do filter(false) instead of filter(Boolean)
Bruce Young
@mutantspore
Feb 29 2016 19:04
@AnthonyGraindorge you need the full http://
bulbrain
@bulbrain
Feb 29 2016 19:05
it works
Anthony
@AnthonyGraindorge
Feb 29 2016 19:06
Thank you @mutantspore
CamperBot
@camperbot
Feb 29 2016 19:06
anthonygraindorge sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
Jeff
@adzam5
Feb 29 2016 19:06
@BossMatt101 Add border: solid to your header calss
CamperBot
@camperbot
Feb 29 2016 19:06
:star: 1186 | @mutantspore | http://www.freecodecamp.com/mutantspore
Anthony
@AnthonyGraindorge
Feb 29 2016 19:06
:)
Bruce Young
@mutantspore
Feb 29 2016 19:08
@JToddFL false works too
Jeremy
@JeremyAntonoff
Feb 29 2016 19:09
@mutantspore no you get "false is not a function error" when you try it
Bruce Young
@mutantspore
Feb 29 2016 19:09
function bouncer(arr) {
  // Don't show a false ID to this bouncer.

  return arr.filter(false);

}

bouncer([false, null, 0, NaN, undefined, ""]);
or change false to Boolean
as I had it originally
Jeremy
@JeremyAntonoff
Feb 29 2016 19:10
hmmm
when i do
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  // I've a hammer fist.

  return arr.filter(false);
}
bouncer([7, "ate", "", false, 9]);
i get
typeerror: false is not a function
Bruce Young
@mutantspore
Feb 29 2016 19:12
ok i see that now in the little black section. It’s just that my answers were still green I guess it stopped at that point.
this is my answer.
function bouncer(arr) {
  // Don't show a false ID to this bouncer.

  return arr.filter(Boolean);

}

bouncer([false, null, 0, NaN, undefined, ""]);
Fabricio Leal
@pharaohlxvi
Feb 29 2016 19:13
Hy guys. I managed to create a button that tweets some randomly generated quotes, with the help of @owenfromcanada. Now i'm facing one small problem. Some of the quotes use two lines of text (for styling purposes), so they have a <br>. How do I exclude this <br> from the tweet? Is that even possible?
bulbrain
@bulbrain
Feb 29 2016 19:15
show us the codepen
Chris
@chrisdav6
Feb 29 2016 19:16
@pharaohlxvi dude that is flippin hilarious! :+1:
Fabricio Leal
@pharaohlxvi
Feb 29 2016 19:17
@chrisdav6 Thanks, man!
CamperBot
@camperbot
Feb 29 2016 19:17
pharaohlxvi sends brownie points to @chrisdav6 :sparkles: :thumbsup: :sparkles:
:star: 295 | @chrisdav6 | http://www.freecodecamp.com/chrisdav6
drdaveg
@drdaveg
Feb 29 2016 19:21
Having some issues with the ziplines. My current issue is can someone tell me why http://codepen.io/drdaveg/pen/KzwdJy does not draw any lines? I have it drawing rectangles as a test but my lines don't show up. Also, why do the graphics disappear? Shouldn't they stay on the screen
Fabricio Leal
@pharaohlxvi
Feb 29 2016 19:22
Any ideas for my problem? It's related to "Build a Random Quote Machine".
Matthew Hiller
@BossMatt101
Feb 29 2016 19:22
Is there any way I can get the border of the header to wrap to the text, leaving white space to either side of the border? I'm using flex btw
bulbrain
@bulbrain
Feb 29 2016 19:23
maybe if you get the html with jquery instead of the quote it will work
Fabricio Leal
@pharaohlxvi
Feb 29 2016 19:24
@bulbrain Right, I see what you mean. Will give it a shot. Thanks.
CamperBot
@camperbot
Feb 29 2016 19:24
pharaohlxvi sends brownie points to @bulbrain :sparkles: :thumbsup: :sparkles:
:star: 285 | @bulbrain | http://www.freecodecamp.com/bulbrain
Chris
@chrisdav6
Feb 29 2016 19:29
@BossMatt101 wrap your header in a .container class
<div class="container">
<div class="header">
      <h1 id="title"><b>ALAN RICKMAN</b></h1>
      <div id="subtext">
        <h3 style="margin-bottom: 0px; margin-top: 0px; font-size: 35px">Lorem Ipsum</h3>
        <h3 style="margin-top: -4px; margin-bottom: 0px; font-size: 35px;">Dolor Amet</h3>
      </div>
  </div>
</div>
Chris
@chrisdav6
Feb 29 2016 19:38
I think you have to add display: flex; to the container too
bulbrain
@bulbrain
Feb 29 2016 19:39
@pharaohlxvi ok if what i told u before doesnt work just add .replace('<br>','') to the myQuotes[ind]
i forked it to test it
Chris
@chrisdav6
Feb 29 2016 19:41
hey @pharaohlxvi if you made .panel a little wider you wouldn't get the line break on long quotes
Martynas
@Marjanus
Feb 29 2016 19:47
Hi, I am working on Portfolio task and I fail in making the separate sections to change their height in mobile devices,according to content (i.e. project placeholders on xs screens takes place at two separate sections). Can anybody provide decent keywords for a possible search of solution?
Catalin Scripcariu
@CatalinScr
Feb 29 2016 19:48
hi can someone tell me why I can't read the api: https://api.twitch.tv/kraken/streams/brunofin
on other user is working
I try to read with json.message but is not working
zivce_
@zivce
Feb 29 2016 19:50
hey there guys I am working on weather app and I want to add weather icons from github
how to do so?
Bruce Young
@mutantspore
Feb 29 2016 19:50
@CatalinScr his account is closed . you have to look at the status error messages
zivce_
@zivce
Feb 29 2016 19:50
there is an api on weather icons for open weather but I don't know how to connect them
Catalin Scripcariu
@CatalinScr
Feb 29 2016 19:50
"Channel 'brunofin' is unavailable" but I can't read it in json
Catalin Scripcariu
@CatalinScr
Feb 29 2016 19:51
I want to take the value and filter with if
Andrew Perrin
@Pezz18
Feb 29 2016 19:52
@zivce-gopro i'm also working on the weather app, however, only just started and really struggling to understand how to use the api's... can you help me work out how to use it??
Bruce Young
@mutantspore
Feb 29 2016 19:52
@CatalinScr this is a bit of my code
if (data.status == 422) {
            tempUsersData.streaming = false;
            tempUsersData.info = "account closed";
            tempUsersData.viewers = null;
Catalin Scripcariu
@CatalinScr
Feb 29 2016 19:52
@mutantspore
 $.getJSON('https://api.twitch.tv/kraken/streams/'+tosearch, function(json) {
    var streamdet="";
    status=json.stream;

         // $("#data").html(json);
          if (json.status === "422") {$("#details").html("<h2 class='status'>Channel Closed</h2>");}
          else {
  if (json.stream === null ){$("#details").html("<h2 class='status'>offline</h2>");}
  else {
    streamdet+="<h2 class='streamimg'>"+json.stream.channel.status+"</h2>";
    streamdet+="<a href='"+json.stream.channel.url +"' target='_blank'>";
    streamdet+="<img class='streamimg imgstream' src='"+json.stream.preview.large+"'>";
    streamdet+="</a>";

   streamdet+="<p class='streamimg viewers'>Viewers: "+json.stream.viewers+"</p>";
    $("#details").html(streamdet);
    }
Bruce Young
@mutantspore
Feb 29 2016 19:52
so yes if you look at the status and if it’s 422 their account is closed
zivce_
@zivce
Feb 29 2016 19:53
sure thing @Pezz18
Granit Hajdini
@nitiblack
Feb 29 2016 19:53
function pairwise(arr, arg) {
  var sum = 0;
  for( var i = 0; i < arr.length; i++ ) {
    for(var j = i + 1; j < arr.length; j++ ) {
      if( arr[i] + arr[j] === arg && i !== j) { 
        sum += i + j;
        console.log(" i: "+ i + " j: " + j + " sum: " + sum);

      }
    }
  }

  return sum;
}

pairwise([1,1,1], 2);
can any body help how to fix that
pairwise([1, 4, 2, 3, 0, 5], 7) should return 11.
pairwise([1, 3, 2, 4], 4) should return 1.
pairwise([1, 1, 1], 2) should return 1.
pairwise([0, 0, 0, 0, 1, 1], 1) should return 10.
pairwise([], 100) should return 0.
Bruce Young
@mutantspore
Feb 29 2016 19:54
@CatalinScr ok so you have a solution? You want more than that? I’m not sure if it’s available
Omar Adulbaki Alsarbaji
@omar-sh
Feb 29 2016 20:06
my wiki viewer :)
http://codepen.io/omarsh/pen/jqEVqo
I didn't take care in design I had a lot of problems controlling the elments
Catalin Scripcariu
@CatalinScr
Feb 29 2016 20:07
@mutantspore Thanks
CamperBot
@camperbot
Feb 29 2016 20:07
catalinscr sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1187 | @mutantspore | http://www.freecodecamp.com/mutantspore
Matt Green
@mattxgreen
Feb 29 2016 20:11
@nitiblack I'll help w that function... can you explain what you're trying to achieve?
drdaveg
@drdaveg
Feb 29 2016 20:12
Any thoughts on why the query of this pen only returns one element for the wikimedia zipline? It seems like the API is context sensitive - if I move parameters around, it fails. http://codepen.io/drdaveg/full/zreNrw/
Alex Dobre
@Zerelt
Feb 29 2016 20:18
can anybody tell me what's wrong with my css / scss ? .. it's working fine on jsbin
the codepen:
http://codepen.io/Zerelt/pen/ZWYYXP?editors=0101
the jsbin:
http://jsbin.com/bugalowebu/edit?css,js,output
Bruce Young
@mutantspore
Feb 29 2016 20:20
@Zerelt perhaps the data visualisation help room would be better as yours is part of that.
Alex Dobre
@Zerelt
Feb 29 2016 20:20
i thought of that but this one is more active
Matt Green
@mattxgreen
Feb 29 2016 20:22
@Zerelt Or at least the frontend room would be more appropriate
doh, we ARE in frontend
:)
Alex Dobre
@Zerelt
Feb 29 2016 20:23
^^
Bruce Young
@mutantspore
Feb 29 2016 20:23
yes but people with experience with react sass etc wil be in data viz
zivce_
@zivce
Feb 29 2016 20:24
could some one help me out with icons for my weather app ?
I would like to use this
in the doc there is something about OpenWeatherMap
api and stuff but how to connect them
found something about this issue :sparkles:
Matt Green
@mattxgreen
Feb 29 2016 20:27
@mutantspore I wasn't being critical of your answer... I actually thought I was in the Backend room :(
Catalin Scripcariu
@CatalinScr
Feb 29 2016 20:28
@zivce-gopro why you don't use the icons from the object received?
karenkomine
@karenkomine
Feb 29 2016 20:29
Hello hello! I am working on building a random quote generator and I'm still pretty new to JSON/APIs, can anyone help me out with fetching a random quote from a random quote API when a certain button is clicked?
Bruce Young
@mutantspore
Feb 29 2016 20:29
lol it’s ok. I wasn’t worried about your reply. just saying why data viz would be better for getting help for @Zerelt
karenkomine
@karenkomine
Feb 29 2016 20:29
General JSON/API help resources would be greatly appreciated too! I've tried heading to Code Academy to see if they've got like a JSON/API curriculum I could boost through, but no dice :( And FCC's isn't all too extensive
zivce_
@zivce
Feb 29 2016 20:31
yep that is one solution @CatalinScr thanks :+1:
CamperBot
@camperbot
Feb 29 2016 20:31
zivce-gopro sends brownie points to @catalinscr :sparkles: :thumbsup: :sparkles:
:star: 335 | @catalinscr | http://www.freecodecamp.com/catalinscr
Catalin Scripcariu
@CatalinScr
Feb 29 2016 20:32
@zivce-gopro np
Bruce Young
@mutantspore
Feb 29 2016 20:32
@zivce-gopro that example uses the code for the OWM icon (a png) to index the new icons that you wish to use.
noncentz
@noncentz
Feb 29 2016 20:34
Hey guys, any tips for the twitch.tv challenge?
Bruce Young
@mutantspore
Feb 29 2016 20:34
@zivce-gopro sorry the condition codes it is .. not icon codes
http://openweathermap.org/weather-conditions
Robert Relativo
@skankpark
Feb 29 2016 20:35
http://www.freecodecamp.com/challenges/build-a-tribute-page omg this is hard i don't know i couldn't start
Omran Abazid
@OmranAbazid
Feb 29 2016 20:36
@noncentz you have to getjson from 2 links this time
noncentz
@noncentz
Feb 29 2016 20:36
@OmranAbazid , so far im grabbing a list of active streams with https://api.twitch.tv/kraken/streams/?channel='+channelsQS
is there another that will return their pictures even if they aren't online?
Robert Relativo
@skankpark
Feb 29 2016 20:38
http://www.freecodecamp.com/challenges/build-a-tribute-page omg this is hard i don't know i couldn't start any one help me?
mauney
@mauney
Feb 29 2016 20:38
Can someone explain a basic twitch.tv concept to me? Every user has his or her own stream at www.twitch.tv/user_name, so what is happening when JackeL, for instance, is on the freeCodeCamp stream at www.twitch.tv/freecodecamp?
@skankpark Have you worked your way through the earlier sections? HTML5 and CSS through jQuery?
Brian
@sludge256
Feb 29 2016 20:41
@mauney We let campers use the official stream if it's not in use
Jeff
@adzam5
Feb 29 2016 20:42
Can anyone tell me why the following code works fine in HTML, but if I use jQuery to produce the HTML it does not format properly. I am trying to produce a Bootstrap media object
This message was deleted
CamperBot
@camperbot
Feb 29 2016 20:42
:bulb: to format code use backticks! ``` more info
Jeff
@adzam5
Feb 29 2016 20:42
This message was deleted
CamperBot
@camperbot
Feb 29 2016 20:42
:bulb: to format code use backticks! ``` more info
Jeff
@adzam5
Feb 29 2016 20:42
$("#online").append(
      "<div class='media'>",
        "<div class='media-left'>",
          "<img src='" + getData.logo + "' class='media-object img-rounded' width='50' alt=''>",
        "</div>",
        "<div class='media-body'>",
          "<h4 class='media-heading'><a href='http://www.twitch.tv/" + getData.name + "' target='_blank'>" + getData.display_name + " </a></h4>",
          "<p id='" + getData.name + "'></p>",
        "</div>",
      "</div>"
    );
noncentz
@noncentz
Feb 29 2016 20:43
@adzam5 , seems like ur passing multiple arguments to append. I think it just wants u to pass it a' string
html string concats are kind of brutal, u could try using template strings and make your life easier.
Jeff
@adzam5
Feb 29 2016 20:44
This code works fine, but i'd rather not use a table
$("#users").append(
      "<tr>",
        "<td><img src='" + getData.logo + "' class='img-rounded' width='50' alt=''></td>",
        "<td><a href='http://www.twitch.tv/" + getData.name + "' target='_blank'>" + getData.display_name + " </a></td>",
        "<td id='" + getData.name + "' class='bold'></td>", 
      "</tr>"
    );
Actually, I don't mind using a table if I can get it to sort properly
noncentz
@noncentz
Feb 29 2016 20:48
Realized that I can probably know a streamers img url just based on their channel name. Guess I'll be okay for this challenge
mauney
@mauney
Feb 29 2016 20:49
@sludge256 Thank you. So JackeL is an authorized broadcaster? Is there a way to get a list of users who are authorized for a channel via the api, or is that private held by the account?
CamperBot
@camperbot
Feb 29 2016 20:49
mauney sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 1713 | @sludge256 | http://www.freecodecamp.com/sludge256
Flávio Carvalho
@flaviocarvalho
Feb 29 2016 20:50
Hi everyone, im doing the weather challenge, but I cant figgure out how to configure the toggle button to change from celsius to fahren, any tips?
Brian
@sludge256
Feb 29 2016 20:50
@mauney We don't have a public list as far as I know
and no not through the API
it has no way of knowing as far as I know
since they would be broadcasting under the FCC channel
mauney
@mauney
Feb 29 2016 20:51
OK, got it. One less feature to implement, I guess. : )
Danny McCollins
@dmccollins
Feb 29 2016 20:52
Hello world
CamperBot
@camperbot
Feb 29 2016 20:52

welcome to FreeCodeCamp @droymac!

Brian
@sludge256
Feb 29 2016 20:52
Yep. Just treat anyone that's broadcasting on that channel as that channel
They do have their own personal streams though
(usually)
mauney
@mauney
Feb 29 2016 20:59
@dAMOOWN I stored two temperature variables, on for C and one for F. When the button is clicked, I checked to see if the display the number stored for C. If it was I changed it to F. Else I changed it to C.
JD Tadlock
@jdtdesigns
Feb 29 2016 21:02
@adzam5 You would need to place your code in the quotes in one argument like this
```
Anna Sakoyan
@ansakoy
Feb 29 2016 21:02
Hi! I realized that I don't quite understand the task in the project with Twitch.tv API (here it is just in case: http://www.freecodecamp.com/challenges/use-the-twitchtv-json-api). Namely, the first two user stories point directly at FCC channel. The third story is about the activity of a stream, that's also clear. But the last one is about notifications regarding non-existent or removed accounts. That means that some other channels should also be considered. This is actually what the sample page shows. So my question is: does it mean that these apart from FCC can be any channels of my choice just as placeholders to check the functionality of the app? Or is there some logic about adding other channels, which I don't grasp?
JD Tadlock
@jdtdesigns
Feb 29 2016 21:02
@adzam5
$('.wrap').append(
"<div class='media-left'><img src='" + getData.logo + "' class='media-object img-rounded' width='50' alt=''></div><div class='media-body'><h4 class='media-heading'><a href='http://www.twitch.tv/" + getData.name + "' target='_blank'>" + getData.display_name + " </a></h4><p id='" + getData.name + "'></p></div></div>"
);
Da Cheezy Mobsta
@mobesa
Feb 29 2016 21:03
Hey everyone
Check out this cool raindrop rendering
I wanna know how this is possible.. can anyone help?
Bruce Young
@mutantspore
Feb 29 2016 21:04
@ansakoy item# 10 gives a list that you might like to use plus add in the 2 that have accounts closed. You can add in any you like. I found some more that were 24/7 so I had more examples. I just went to the twitch site and searched for some.
@ansakoy my list
 // sample Twitch TV Users
  var twitchUsers = [
    "freecodecamp",
    "storbeck",
    "terakilobyte",
    "habathcx",
    "RobotCaleb",
    "comster404",
    "brunofin",
    "thomasballinger",
    "noobs2ninjas",
    "beohoff",
    "MedryBW",
    "fixt",
    "monstercat",
    "aces_tv",
    "youredm",
    "karachencev"
  ];
Thomas Honeyman
@thomashoneyman
Feb 29 2016 21:06
@0x0936 thanks for the help! Simply declaring the global temperature variable fixed the issues.
CamperBot
@camperbot
Feb 29 2016 21:06
saylu sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 1210 | @0x0936 | http://www.freecodecamp.com/0x0936
Brandon Lee
@brandonlee781
Feb 29 2016 21:07
I'm super early in my portfolio project but I'm having an issue with bootstrap navbar. I have it set to collapse on smaller screen but when I re-size my browser the entire navbar disappears.
<nav class="navbar navbar-default navbar-static-top">
  <div class="container">
    <div class="collapse navbar-collapse">
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#">About Me</a></li>
        <li><a href="#">My Work</a></li>
        <li><a href="#">Contact</a></li>
      </ul>
    </div><!-- navbar collapse -->
  </div><!-- container -->
</nav>
Anna Sakoyan
@ansakoy
Feb 29 2016 21:07
@mutantspore thanks. So, no particular sense, apart from the practical thing. Thanks again.
Flávio Carvalho
@flaviocarvalho
Feb 29 2016 21:07
@mauney ohh right, ill try it, thanks ;)
CamperBot
@camperbot
Feb 29 2016 21:07
:star: 1188 | @mutantspore | http://www.freecodecamp.com/mutantspore
ansakoy sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 308 | @mauney | http://www.freecodecamp.com/mauney
damoown sends brownie points to @mauney :sparkles: :thumbsup: :sparkles:
Jeff
@adzam5
Feb 29 2016 21:08
@jdtdesigns That worked! Thank you. I was trying to break the code up to make it easier to read
CamperBot
@camperbot
Feb 29 2016 21:08
adzam5 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:star: 278 | @jdtdesigns | http://www.freecodecamp.com/jdtdesigns
hakimnasir
@hakimnasir
Feb 29 2016 21:10
if i'm splitting a page into 2 colums (col-xs-6), do I need to make 2 "container" div's?
Rex Smith Jr.
@rsmith731
Feb 29 2016 21:11
i need help please
Bruce Young
@mutantspore
Feb 29 2016 21:12
@rsmith731 ask away
Rex Smith Jr.
@rsmith731
Feb 29 2016 21:14
if i'm using bootstrap and i want to put an icon/logo here, how would i go about doing so? <a class="navbar-brand page-scroll" href="#page-top">Who Is Rex?</a>
Nicholas
@nick88p
Feb 29 2016 21:15
@hakimnasir no, you just wrap it all in a <div="row"> and then individual divs for each column
hakimnasir
@hakimnasir
Feb 29 2016 21:15
@nick88p awesome, thanks
CamperBot
@camperbot
Feb 29 2016 21:15
hakimnasir sends brownie points to @nick88p :sparkles: :thumbsup: :sparkles:
:star: 432 | @nick88p | http://www.freecodecamp.com/nick88p
Bruce Young
@mutantspore
Feb 29 2016 21:16
@rsmith731 did you look at the info on the bootstrap page?
http://getbootstrap.com/components/#navbar-brand-image
Rex Smith Jr.
@rsmith731
Feb 29 2016 21:17
@mutantspore no, but i will...thanks
CamperBot
@camperbot
Feb 29 2016 21:17
rsmith731 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
Flávio Carvalho
@flaviocarvalho
Feb 29 2016 21:17
Hi guys, can someone help me understand why my toggle isnt working: http://codepen.io/dAMOWN/pen/aNzmJe
CamperBot
@camperbot
Feb 29 2016 21:17
:star: 1189 | @mutantspore | http://www.freecodecamp.com/mutantspore
Bruce Young
@mutantspore
Feb 29 2016 21:21
@dAMOOWN it wil have Temperature: as part of the text on the screen ?
Flávio Carvalho
@flaviocarvalho
Feb 29 2016 21:21
@mutantspore yea I just found out that part, trying to fix it now
Matthew Boland
@mattboland
Feb 29 2016 21:21
can someone help me understand what the next step is here. I am working on the wiki viewer project and am able to create a url with the users input that gives me a json object. I don't understand what i can do with this object now... any nudging in the right direction is appreciated http://codepen.io/MattBoland/pen/WrVJGP?editors=1010
Bruce Young
@mutantspore
Feb 29 2016 21:23
@dAMOOWN perhaps just set some sort of flag/boolean as you change it
mauney
@mauney
Feb 29 2016 21:26
@dAMOOWN $('.temp').val() comes back as an empty string
try .html() intead of .val()
oh, you have the whole "Temperture: xx" as the html, so that won't work, either
Flávio Carvalho
@flaviocarvalho
Feb 29 2016 21:29
yea I added another p inside each, and trying to toggle based on the class, check it out now
not working but trying to figgure out why :/
Clark Arnold
@clarkarnold
Feb 29 2016 21:30
Hi all, I am having a hard time with validating US telephone number algorithm.. I can get almost all correct matches except when there are not matching parenthesis .. such as 654) 555 5555
return /^1?\s?\D?\d{3}\D*?\d{3}\D?\d{4}$/.test(str);
That is the regex i have so far.. I googled and search all over stack exchange but can't figure out how to only select matching parenthesis
Bruce Young
@mutantspore
Feb 29 2016 21:33
@dAMOOWN you didn’t change the class of teh actual temp div to .tempCF
noncentz
@noncentz
Feb 29 2016 21:33
@clarkarnold , it sounds like u want regexp capture groups?
mauney
@mauney
Feb 29 2016 21:34
@dAMOOWN Might be easier to go with @mutantspore 's suggestions and set a var isCelsius = true that you can toggle.
Bruce Young
@mutantspore
Feb 29 2016 21:34
@mauney lol yes
got to go now
Clark Arnold
@clarkarnold
Feb 29 2016 21:34
@noncentz Ill check that out!
Flávio Carvalho
@flaviocarvalho
Feb 29 2016 21:34
okay ill try it! thanks @mutantspore @mauney
CamperBot
@camperbot
Feb 29 2016 21:34
damoown sends brownie points to @mutantspore and @mauney :sparkles: :thumbsup: :sparkles:
:warning: damoown already gave mauney points
:star: 1190 | @mutantspore | http://www.freecodecamp.com/mutantspore
Amir Ghafouri
@amirghafouri
Feb 29 2016 21:36

@mutantspore I want to be able to extract data from calls like this: https://api.twitch.tv/kraken/streams?game=Poker

What is the best method? I understand that $.getJSON has some limitations? I read Saint Peter's post (https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Front-End-Project-Use-the-Twitchtv-JSON-API) and noticed that what shows up in the console when I make that call in codepen is a shortened version of what shows up when I just paste the url of the call on my browser

drdaveg
@drdaveg
Feb 29 2016 21:36
Got some HTML5 drawing to work for tic-tac-toe...but any thoughts on why this pen retrieves at most one Wikipedia article for Wikipedia viewer? http://codepen.io/drdaveg/pen/zreNrw
hakimnasir
@hakimnasir
Feb 29 2016 21:39
sorry I have beginner's question. If have multiple pages (scrolling), do I need to have separate "container" divs or the whole site is wrapped in one "container"+"row" and then have separate divs for columns?
Claire Walker
@kjarva
Feb 29 2016 21:41
Hey folks, got a probaby ridiculously stupid question. I am just starting my portfolio page and have fallen at the first fence. My navbar text is not on the right, even though I have added the navbar-right class to the bar. Any idea why? http://codepen.io/kjarva/pen/dMPbyR
Rex Smith Jr.
@rsmith731
Feb 29 2016 21:43
@kjarva you would have to style it wth CSS
Brandon Lee
@brandonlee781
Feb 29 2016 21:44
@kjarva It's because it's within the navbar-header div. Remove it and place your "brand" in that one and it'll go to the left.
Claire Walker
@kjarva
Feb 29 2016 21:45
oh, I thought the navbar-right class was built into bootstrap by the docs? gotcha - thanks @brandonlee781 @rsmith731
CamperBot
@camperbot
Feb 29 2016 21:45
kjarva sends brownie points to @brandonlee781 and @rsmith731 :sparkles: :thumbsup: :sparkles:
:star: 59 | @rsmith731 | http://www.freecodecamp.com/rsmith731
:star: 133 | @brandonlee781 | http://www.freecodecamp.com/brandonlee781
Brandon Lee
@brandonlee781
Feb 29 2016 21:45
@kjarva I'm also not 100% certain on this but <body> tags might be redundant on codepen
Claire Walker
@kjarva
Feb 29 2016 21:46
that fixed it @brandonlee781 as soon as I removed that line, sorted it right out ;)
Nick Burress
@4trio19
Feb 29 2016 21:47
Yeah the navbar right was inside the nav header which is floated left
closed the div and it fixed
Brandon Lee
@brandonlee781
Feb 29 2016 21:49
I'm actually also having a problem with navbars. I have my portfolio going http://codepen.io/brandonlee781/pen/jqEyYB?editors=1100 and I can't get the mobile nav button to work. Took me forever just to get the button to show up, but now when I click on it, nothing happens. What am I missing?
Nick Burress
@4trio19
Feb 29 2016 21:51
Did you include jQuery and the Bootstrap JS files?
@brandonlee781
Brandon Lee
@brandonlee781
Feb 29 2016 21:52
@burressdesign I did. Tried with both jQuery and Bootstrap loaded first, neither way worked. If that even makes a difference.
Nick Burress
@4trio19
Feb 29 2016 21:52
Yeah I see that. It's weird the console says Bootstrap requires jQuery
Brandon Lee
@brandonlee781
Feb 29 2016 21:53
Ugh. I figured it out. For some reason the target on the button wouldn't work if it was aimed at an id on the list, but it worked fine when aimed at the class on the list.
Nick Burress
@4trio19
Feb 29 2016 21:53
Ahh Nice
Was working by the time I clicked back over
Brandon Lee
@brandonlee781
Feb 29 2016 21:53
@burressdesign Thanks for the help though
CamperBot
@camperbot
Feb 29 2016 21:53
brandonlee781 sends brownie points to @burressdesign :sparkles: :thumbsup: :sparkles:
:star: 380 | @burressdesign | http://www.freecodecamp.com/burressdesign
Nick Burress
@4trio19
Feb 29 2016 21:53
No prob
Flávio Carvalho
@flaviocarvalho
Feb 29 2016 21:54
guys my codepen stopped working for some reason lol http://codepen.io/dAMOWN/pen/aNzmJe?editors=1010
it says loading forever
Nick Burress
@4trio19
Feb 29 2016 21:54
Worked for me when I switched to fullscreen. Not sure why its not in the pen
Flávio Carvalho
@flaviocarvalho
Feb 29 2016 21:55
@burressdesign meh it was my css that was messed up lol
Nick Burress
@4trio19
Feb 29 2016 21:56
Thats an easy one to fix up at least
Flávio Carvalho
@flaviocarvalho
Feb 29 2016 21:56
true :smile:
Nick Burress
@4trio19
Feb 29 2016 21:57
Any feedback on Wiki Viewer, I think I'm moving on to the Twitch.tv zipline: http://codepen.io/4trio19/full/bpGpLb
Flávio Carvalho
@flaviocarvalho
Feb 29 2016 21:59
@burressdesign really cool! are we suposed to add alot of styles for this projects, or what matters is the functionality?
al nmeri
@nmeri17
Feb 29 2016 22:00

@raybotha

@nmeri17 codepen is much more focused on the coding than the actual hosting. Drive works, amazon s3 also does the same kind of thing as drive but more focused on developers and scaleability, and it's free for our level of use of course, might be worth checking out.

Hey! I'm just getting your mention. Erm...I have issues with services that require me to load my files on someone else's servers. Drive gives me everything I want just like the links on my local file system, I don't have to alter anything

JD Tadlock
@jdtdesigns
Feb 29 2016 22:00
@brandonlee781 works fine with me
Nick Burress
@4trio19
Feb 29 2016 22:01
Functionality I believe. I just wanted to give angular material a test ride and always like practicing with animation
Plus I had one of my FCC zipline pens get viewed 1300+ times, so it's good to have it done all out when something like that happens
Also, I always add some breakpoints so it works across devices. That should be required imo
Boris
@boris-in-london
Feb 29 2016 22:17
@burressdesign beautiful work, impressive.
sim2
@sim2
Feb 29 2016 22:17

function abTest(a, b) {
// Only change code below this line

// Only change code above this line

return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}

// Change values below to test your code
abTest(2,2);

how do I retrun the function early???
they want me to return undefined if a or b are less than 0
Andrew Perrin
@Pezz18
Feb 29 2016 22:19
$(document).ready(function(){
    $("#button").click(function(){
        $.getJSON("api.openweathermap.org/data/2.5/weather?lat=53.795984&lon=-1.759398&APPID=667040815f69a4404164c799cc4f1259", function(data){
            var temp = data.main.temp;
            $('#update').html('<p>'+"hello"+'</p>');
        });
    });
});
hi, can anyone tell me if there is anything wrong with my code? i am struggling to get the api for the weather challenge to work correctly...
Boris
@boris-in-london
Feb 29 2016 22:20
@sim2 i think you solved it. use an if statement with a return in its block. like if ( a <= 0 || b <= 0 )
Andrew Perrin
@Pezz18
Feb 29 2016 22:21
sorry, just noticed where it says $('#update').html('<p>'+"hello"+'</p>');
it should read: $('#update').html('<p>'+temp+'</p>');
Coira Ellison
@Coira
Feb 29 2016 22:22
@Pezz18 change this api.openweather.etc to //api.openweathermap.org
Andrew Perrin
@Pezz18
Feb 29 2016 22:23
@Coira thanks for that, just tried it, but its still not working ... hmmm
CamperBot
@camperbot
Feb 29 2016 22:23
pezz18 sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 498 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Feb 29 2016 22:24
do you have a codepen?
Andrew Perrin
@Pezz18
Feb 29 2016 22:24
yes, although not converted this into a pen as yet,, but can do...
Coira Ellison
@Coira
Feb 29 2016 22:24
i stuck your code in a pen here http://codepen.io/Coira/pen/QNwppm
Andrew
@Designinglife11
Feb 29 2016 22:24
hey guys im looking to set my background image as fixed so i can just scroll through info but its not working. any tips?
Coira Ellison
@Coira
Feb 29 2016 22:26
@Pezz18 oh yeah, i took the $(#update) stuff out and replaced it with console for convenience
Andrew Perrin
@Pezz18
Feb 29 2016 22:26
ok...
sim2
@sim2
Feb 29 2016 22:27
@boris-in-london I'm not sure exactly what to do can you walk me through it ?
Coira Ellison
@Coira
Feb 29 2016 22:27
because i wasn't sure what your html looked like, maybe the problem lies with your html?
Andrew Perrin
@Pezz18
Feb 29 2016 22:27
@Coira did you add the jquery cdn thing under the JS settings?
Coira Ellison
@Coira
Feb 29 2016 22:27
yes
Andrew Perrin
@Pezz18
Feb 29 2016 22:27
ok, so when you click the button do you see the expected request?
Coira Ellison
@Coira
Feb 29 2016 22:28
yep, in the console it prints out 274.694
(do you know how to use the console?)
Andrew Perrin
@Pezz18
Feb 29 2016 22:28
no... but i changed it to alert(temp) instead and saw the 274.694
how do you use the console then?
oh, just seen the console button at bottom of the screen!!
Coira Ellison
@Coira
Feb 29 2016 22:29
great :) was just gonna do you a screenshot
also, f12 opens a console if you're not on codepen
Andrew Perrin
@Pezz18
Feb 29 2016 22:30
@Coira ok, so would you mind taking a look at my html then? :)
Coira Ellison
@Coira
Feb 29 2016 22:30
yep, just send me your codepen when you have it
Andrew Perrin
@Pezz18
Feb 29 2016 22:30
ok,, cool, give me 5 mins,..
@Coira all sorted... when i put it into codepen, i noticed one of my " " had a "' attached to it causing an error :)
JD Tadlock
@jdtdesigns
Feb 29 2016 22:34
@Designinglife11 I'd put it in a div and place that behind everything using fixed positioning http://codepen.io/jdtadlock/pen/xVbqWb?editors=1100
Coira Ellison
@Coira
Feb 29 2016 22:34
@Pezz18 :) good catch
Samuel Jones
@samjcs
Feb 29 2016 22:36
I have a question about div's
Andrew Perrin
@Pezz18
Feb 29 2016 22:36
@Coira however, just tested my code back using notepad++ and it doesnt work in my browser, however it does using the pen i just created!
Tiffany White
@twhite96
Feb 29 2016 22:36
Need some help with my pen
Coira Ellison
@Coira
Feb 29 2016 22:36
@Pezz18 do you get any sort of errors in the console?
Tiffany White
@twhite96
Feb 29 2016 22:36
Trying to align the text to the left and in a clock, sort of. Nothing I’ve tried works so far.
Boris
@boris-in-london
Feb 29 2016 22:37

@sim2 it's a bit much to write out here... so i gathered a few resources that should help you solve it.

http://www.w3schools.com/js/js_if_else.asp
http://www.w3schools.com/jsref/jsref_return.asp
https://en.wikipedia.org/wiki/Boolean
https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/How-to-get-help-when-you-get-stuck

If still fuzzy about the concepts private message me pls.

Andrew Perrin
@Pezz18
Feb 29 2016 22:37
@Coira now i know about the console in the browser (f12)! just had a look and yes, i have this error: XMLHttpRequest cannot load file://api.openweathermap.org/data/2.5/weather?lat=53.795984&lon=-1.759398&APPID=667040815f69a4404164c799cc4f1259. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
Coira Ellison
@Coira
Feb 29 2016 22:38
do you have this at the beginning of your url file://api ?
Andrew Perrin
@Pezz18
Feb 29 2016 22:39
no,, it just starts with //api.... should i add file:?
Coira Ellison
@Coira
Feb 29 2016 22:39
try http://api.openweather... etc
no, that's why i'm confused
Tiffany White
@twhite96
Feb 29 2016 22:39
Essentially, the reason I have classes and ids in the p tags is for a jQuery, when I write it. I want to style all the paragraphs the same way using a class and then target the quotes using jQuery. I also need to add a button for clicking. What I am trying to say is that I want the user to click a button that will display the quotes onen at a time once they click the button a few times. However I can’t get this text aligned correctly.
Coira Ellison
@Coira
Feb 29 2016 22:40
or do you have https everywhere extension? @Pezz18
Boris
@boris-in-london
Feb 29 2016 22:40
@twhite96 you want to align the text to the left in the shape of a clock?
JD Tadlock
@jdtdesigns
Feb 29 2016 22:40
@twhite96 From your description, i'm not sure what you are wanting to achieve. The text is aligned left by default and I don't see a clock lol.
Andrew Perrin
@Pezz18
Feb 29 2016 22:41
@Coira how do you mean https everywhere? the only place i used https was in the cdj ajax google jscript link thing...
Tiffany White
@twhite96
Feb 29 2016 22:41
No @jdtdesigns I meant to write block
Coira Ellison
@Coira
Feb 29 2016 22:41
@Pezz18 browser add-on, just a shot in the dark really
Tiffany White
@twhite96
Feb 29 2016 22:42
I want the text to align left in a justified way
Nick Burress
@4trio19
Feb 29 2016 22:42
thanks @boris-in-london
CamperBot
@camperbot
Feb 29 2016 22:42
burressdesign sends brownie points to @boris-in-london :sparkles: :thumbsup: :sparkles:
:star: 303 | @boris-in-london | http://www.freecodecamp.com/boris-in-london
Andrew Perrin
@Pezz18
Feb 29 2016 22:42
hmm dont think so..
Tiffany White
@twhite96
Feb 29 2016 22:42
@boris-in-london meant to write block
Andrew Perrin
@Pezz18
Feb 29 2016 22:42
hang on i will see if it runs in IE
well, it didnt run in IE either, and there were no errors, nor any text showing in the console-log...
also tried in firefox with no luck!
Coira Ellison
@Coira
Feb 29 2016 22:44
well, that's ie for you, let me try setting up locally
Andrew Perrin
@Pezz18
Feb 29 2016 22:44
strange though as it works in the pen!
could it be my html!?
Coira Ellison
@Coira
Feb 29 2016 22:45
yeah, very weird
Andrew Perrin
@Pezz18
Feb 29 2016 22:45
obviously codepen sets up the <head> tags etc automatically,,,
JD Tadlock
@jdtdesigns
Feb 29 2016 22:45
@twhite96 post an image of what you're trying to achieve
Nick Burress
@4trio19
Feb 29 2016 22:45
Yeah @Pezz18 , do you have all your js included in your non codepen code?
Coira Ellison
@Coira
Feb 29 2016 22:45
good point, maybe codepen's doing something you're missing localy
Nick Burress
@4trio19
Feb 29 2016 22:45
And where is it 274deg?!
Coira Ellison
@Coira
Feb 29 2016 22:46
london obviously! :p
Andrew Perrin
@Pezz18
Feb 29 2016 22:46
@burressdesign yeah, not sure about the resulting temp!!!
Coira Ellison
@Coira
Feb 29 2016 22:46
i think that's in kelvin
Nick Burress
@4trio19
Feb 29 2016 22:47
I think you're right @Coira
Tiffany White
@twhite96
Feb 29 2016 22:47
@jdtdesigns the left-aligned text is what I am trying to achieve in this article https://css-tricks.com/almanac/properties/t/text-align/
Andrew Perrin
@Pezz18
Feb 29 2016 22:47
my js code is exactly like the codepen code in the js box
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="WeatherAPI.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript" src="WeatherAPI.js"></script>
</head>

<body>
<div>
<div>
<p>Local Weather</p>
<button id="button">Click Me!</button>

</div>
<div id="update"></div>

</body>
</html>
Nick Burress
@4trio19
Feb 29 2016 22:47
Yeah but do you have <script>link to jquery</script
Andrew Perrin
@Pezz18
Feb 29 2016 22:48
this is my html
Nick Burress
@4trio19
Feb 29 2016 22:48
Try the scripts before the closing body tag?
Andrew Perrin
@Pezz18
Feb 29 2016 22:48
am i doing something wrong there?
Tiffany White
@twhite96
Feb 29 2016 22:48
Actually, @jdtdesigns I want to justify the text
Like they have in the article I posted
Nick Burress
@4trio19
Feb 29 2016 22:50
The only thing I see is that I normally have my scripts before closing body tag
Boris
@boris-in-london
Feb 29 2016 22:50
@twhite96 you may need some JavaScript for that affect. Make a div, then use js to add your quotes for example: document.getElementById"#yourID".innerHTML = "quote", add a on'click event to that. Then float that div to left.
Andrew Perrin
@Pezz18
Feb 29 2016 22:50
ok, i put the <scripts> before the closing body tag and still no look!
Nick Burress
@4trio19
Feb 29 2016 22:50
I think you have an extra div tag as well
JD Tadlock
@jdtdesigns
Feb 29 2016 22:50
@twhite96 can't open the article
Nick Burress
@4trio19
Feb 29 2016 22:50
Gotcha
JD Tadlock
@jdtdesigns
Feb 29 2016 22:50
says bad gateway
Tiffany White
@twhite96
Feb 29 2016 22:51
Yeah it’s been slow all day @jdtdesigns
Coira Ellison
@Coira
Feb 29 2016 22:51
@Pezz18 if i open the page just by opening index.html i get an error, if i open it through a local server (i use mongoose) then it works fine
Tiffany White
@twhite96
Feb 29 2016 22:51
Yeah that’s what I thought @boris-in-london. Thanks
CamperBot
@camperbot
Feb 29 2016 22:51
twhite96 sends brownie points to @boris-in-london :sparkles: :thumbsup: :sparkles:
:star: 304 | @boris-in-london | http://www.freecodecamp.com/boris-in-london
Coira Ellison
@Coira
Feb 29 2016 22:51
i don't know what that means tho @Pezz18
Kenneth Black
@LawlietBlack
Feb 29 2016 22:52
anyone familiar with ui-router?
Andrew Perrin
@Pezz18
Feb 29 2016 22:52
yep, ok, removed the additional div and put <script>s before the closing body, but no luck
@Coira @burressdesign oh well, at least it works in the pen, so can continue to develop it within that...
Coira Ellison
@Coira
Feb 29 2016 22:53
@Pezz18 true. if i figure it out i'll let you know
Andrew Perrin
@Pezz18
Feb 29 2016 22:53
just need to work out why im getting an odd temp now though!
JD Tadlock
@jdtdesigns
Feb 29 2016 22:53
@twhite96 You have small paragraphs so the justified effect won't show
Coira Ellison
@Coira
Feb 29 2016 22:53
specify you want the temp in c or f :)
JD Tadlock
@jdtdesigns
Feb 29 2016 22:53
if you bundle the text together it will work
Tiffany White
@twhite96
Feb 29 2016 22:53
Okay. Thanks @jdtdesigns. That isn’t what I am going for. Going to need js to get it done
CamperBot
@camperbot
Feb 29 2016 22:53
twhite96 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:star: 281 | @jdtdesigns | http://www.freecodecamp.com/jdtdesigns
Nick Burress
@4trio19
Feb 29 2016 22:54
@Pezz18 fwiw, I pasted that stuff into my code editor and ran it locally. Got 274.674
Coira Ellison
@Coira
Feb 29 2016 22:54
@Pezz18 oh, you do have http or https in front of your jquery address and your api.weather address?
JD Tadlock
@jdtdesigns
Feb 29 2016 22:55
@twhite96 the small little box of justified text?
Nick Burress
@4trio19
Feb 29 2016 22:55
blob
Coira Ellison
@Coira
Feb 29 2016 22:55
yeah works for me too, i always forget that you have to put http[s] in if not running from server @burressdesign
Andrew Perrin
@Pezz18
Feb 29 2016 22:56