These are chat archives for FreeCodeCamp/HelpFrontEnd

25th
Feb 2016
Michael Betts
@MichaelFlops
Feb 25 2016 00:00
@Funlovn007 i.e. <ul class="text-center”> … </ul>
Mungo Dewar
@DewarM
Feb 25 2016 00:00
Has anyone used the wind icons successfully in https://erikflowers.github.io/weather-icons/ ? I can get the regular ones working but the wind icons are causing me problems, I have the additional CSS file but no such luck! Any help?
A-Alex-A
@A-Alex-A
Feb 25 2016 00:00
@roryavant8 the las is moon, but it worked because JS for it was before the broken code and plutoTwo function call was after the broken code
Andrea
@Funlovn007
Feb 25 2016 00:02
blob
blob
@MichaelFlops this is what the end result looked like when I added that
Bruce Young
@mutantspore
Feb 25 2016 00:03
@DewarM i see it says that you also need to include weather-icons-wind.css
@DewarM lol ok you have that
Mungo Dewar
@DewarM
Feb 25 2016 00:07
@mutantspore Yup got it! I got it working thanks! Needed an extra class, "wi-wind" in the <i> was using :smile:
CamperBot
@camperbot
Feb 25 2016 00:07
dewarm sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1162 | @mutantspore | http://www.freecodecamp.com/mutantspore
Michael Betts
@MichaelFlops
Feb 25 2016 00:08
@Funlovn007 oo yikes, I didn’t catch that - this is one of the cons of bootstrap, you can get hung up on some lame stuff because there’s a lot of css going on that isn’t obvious- I think your solution is something like adding the classes list-inline and center-block, and then wrapping it in a container
@Funlovn007 I’ll try and find a solution on your codepen!
Andrea
@Funlovn007
Feb 25 2016 00:08
@MichaelFlops You are amazing thank you! Maybe Center-block will work? Will give it a try
CamperBot
@camperbot
Feb 25 2016 00:08
funlovn007 sends brownie points to @michaelflops :sparkles: :thumbsup: :sparkles:
:warning: funlovn007 already gave michaelflops points
Andrea
@Funlovn007
Feb 25 2016 00:17
@MichaelFlops neither helped. Still looking
John Butler
@TheJLB
Feb 25 2016 00:18
Help... working on the WikiSearch zipline and it works in editor mode, but none of the functionality works in full mode. http://codepen.io/TheJLB/pen/jWBMXw
CamperBot
@camperbot
Feb 25 2016 00:18
no wiki entry for: working on the wikisearch zipline and it works in editor mode but none of the functionality works in full mode httpcodepeniothejlbpenjwbmxw
Michael Betts
@MichaelFlops
Feb 25 2016 00:18
@Funlovn007 aha sorry it took a second, I got it!!!! You need to take out the ul padding, it’s over riding the center-block
@Funlovn007 and then just have your ul look like <ul class=" center-block list-inline text-center”> which works, but you lose the dots :).
sean9
@sean9
Feb 25 2016 00:20
@mutantspore i kind of see what you did do my pen, but this is all i see in console
"getCurrentPosition() and watchPosition() are deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details."
Michael Betts
@MichaelFlops
Feb 25 2016 00:21
@Funlovn007 If you REALLY wanted to get the dots and have it be a centered list, I’m not sure of an easy way of doing that outside of bootstrap, but when you write stuff in the future- it helps to check out their components, http://getbootstrap.com/components/ (for example they have a nice looking ul li list kind of deal)
Andrea
@Funlovn007
Feb 25 2016 00:24
@MichaelFlops I tried everything you said, but ended up with this
http://codepen.io/Funlovn007/pen/wMZYxp
@MichaelFlops Ha ha, maybe I'm a moron. Thank you so much for helping!
CamperBot
@camperbot
Feb 25 2016 00:26
funlovn007 sends brownie points to @michaelflops :sparkles: :thumbsup: :sparkles:
:warning: funlovn007 already gave michaelflops points
Michael Betts
@MichaelFlops
Feb 25 2016 00:27
@Funlovn007 you’re not a moron! This stuff takes time
John Butler
@TheJLB
Feb 25 2016 00:28
Anyone seen an issue with codepen.io where a page works in editor mode but not in full mode?
Bruce Young
@mutantspore
Feb 25 2016 00:28
@sean9 I think that’s just google complaining that codepen was called using http rather than https.
you should also see an object in the console.
Michael Betts
@MichaelFlops
Feb 25 2016 00:28
@Funlovn007 In that link, you just have to go to the ul in the css and delete the padding line
Andrea
@Funlovn007
Feb 25 2016 00:29
@MichaelFlops Hold on, it only showed the previous version not the new version - wait a second
http://codepen.io/Funlovn007/pen/wMZYxp
You are very helpful and thank you so much for taking the time!
CamperBot
@camperbot
Feb 25 2016 00:29
funlovn007 sends brownie points to @michaelflops :sparkles: :thumbsup: :sparkles:
:warning: funlovn007 already gave michaelflops points
Michael Betts
@MichaelFlops
Feb 25 2016 00:29
@Funlovn007 Then in your html make the <ul> tag this: <ul class=" center-block list-inline text-center”>
aha yeah it was!
okay cool you did it
you talking about the dots thing?
Bruce Young
@mutantspore
Feb 25 2016 00:31
@sean9 ok now I have “stringifyed” it and it’s on the actual page .. just so you can see it. but you won’t need to do that to actually use it.
Andrea
@Funlovn007
Feb 25 2016 00:31
Yeah, but its not like the example. The example is showing everything in an inline format ie:
blob
where all the dates line up , whereas mine is all in a single paragrah?
Michael Betts
@MichaelFlops
Feb 25 2016 00:34
oooo okay, then if you’d like that its easy- just make a container, then a row and then put just the <ul > inside of that
Andrea
@Funlovn007
Feb 25 2016 00:34
ok, thank you @MichaelFlops. Am trying that now.
CamperBot
@camperbot
Feb 25 2016 00:34
funlovn007 sends brownie points to @michaelflops :sparkles: :thumbsup: :sparkles:
:warning: funlovn007 already gave michaelflops points
A-Alex-A
@A-Alex-A
Feb 25 2016 00:36
@Funlovn007 why do you use spans for the list elements?
Michael Betts
@MichaelFlops
Feb 25 2016 00:36
Screen Shot 2016-02-24 at 4.35.01 PM.png
@Funlovn007 it should look something like that
@Funlovn007 @A-Alex-A is pointing out something important, in bootstrap you don’t need to add much css (and when you do you need to be really specific about it so that it doesn’t affect other classes unknowingly), you can make those dates bold using bootstrap’s <strong> tags, here’s my tribute project (there isn’t any added css) http://codepen.io/michaelflops/pen/eJwbXW
Andrea
@Funlovn007
Feb 25 2016 00:41
@A-Alex-A I was looking how to make one specific part of a ul - and they said to use span to make the numbers bold
A-Alex-A
@A-Alex-A
Feb 25 2016 00:41
@MichaelFlops I used <b> for li's, is strong tag more correct when using bootstrap?
Andrea
@Funlovn007
Feb 25 2016 00:45
@MichaelFlops So I don't need to add an entire span class just to highlight it? Huh, learning something new everyday! :smile:
Michael Betts
@MichaelFlops
Feb 25 2016 00:45
@A-Alex-A hmmm no, either or is fine in this case
@Funlovn007 aha nice!
genesisjoec
@genesisjoec
Feb 25 2016 00:56
How do I make a call to an API within codepen
Bruce Young
@mutantspore
Feb 25 2016 00:58
@genesisjoec it’s a bit hard to answer such a general question. you have done the FCC stuff on API’s?
genesisjoec
@genesisjoec
Feb 25 2016 00:59
Yes, I believe so.
Bruce Young
@mutantspore
Feb 25 2016 00:59
@genesisjoec which particular one are you working with?
genesisjoec
@genesisjoec
Feb 25 2016 00:59
I'm trying to create a weather app.
And use open weather map api
Bruce Young
@mutantspore
Feb 25 2016 00:59
ok so you are going to use teh openwaether map api?
ok
genesisjoec
@genesisjoec
Feb 25 2016 00:59
I've been
Bruce Young
@mutantspore
Feb 25 2016 00:59
you’ll need an api key from them also
genesisjoec
@genesisjoec
Feb 25 2016 01:00
stuck on this one for about 4 days now
I have the key
Bruce Young
@mutantspore
Feb 25 2016 01:00
firstly you’ll need to get the users location
geolocate
do you have a pen that you have been working on?
genesisjoec
@genesisjoec
Feb 25 2016 01:01
yes
it's not much
Bruce Young
@mutantspore
Feb 25 2016 01:02
wel that’s good.. start small.. get bits working
and you are going to show us?
Dan Stockham
@DanStockham
Feb 25 2016 01:06
Can anyone tell me why sq is not defined on line 36 of my javascript? http://codepen.io/DanStockham/pen/LGobvp?editors=0010
There's no reason for sq to be undefined.
nevermind I found it.
Diego Jara
@saintplay
Feb 25 2016 01:42
Helllo, I want to learn Node, can someone suggest me a good tutorial to start? :smile:
Bruce Young
@mutantspore
Feb 25 2016 01:45
try FreeCodeCamp/HelpBackEnd
for help
rooms
CamperBot
@camperbot
Feb 25 2016 01:45

rooms

See all the FreeCodeCamp rooms at gitter.im/FreeCodeCamp/rooms
Or check this wiki article for a shortlist
Lanitta
@DivaWeb
Feb 25 2016 02:38
http://codepen.io/DivaWeb/pen/XXOdEX I need to try to figure out why when I hover over one button they all move
it is in my contact page
Daniel Drasdo
@danieldrasdo
Feb 25 2016 02:39
If you're using chrome, you can right click an element your inspecting and select :hover.
Jeff
@adzam5
Feb 25 2016 02:39
How can I fade in a div each time a button is pressed? Right now I am using jQuery toggleClass but that only works every other time the button is pressed
Daniel Drasdo
@danieldrasdo
Feb 25 2016 02:39
Makes it easier to debug @DivaWeb
storbeck
@storbeck
Feb 25 2016 02:40
@adzam5 set the transition in css, use a timeout function to remove the class and add in a static class
Lanitta
@DivaWeb
Feb 25 2016 02:41
@danieldrasdo can you tell me how to inspect my code from code pen's code because I have to figure that out
Jeff
@adzam5
Feb 25 2016 02:41
@storbeck Thanks
CamperBot
@camperbot
Feb 25 2016 02:41
adzam5 sends brownie points to @storbeck :sparkles: :thumbsup: :sparkles:
:star: 1540 | @storbeck | http://www.freecodecamp.com/storbeck
Daniel Drasdo
@danieldrasdo
Feb 25 2016 02:45
Yea @DivaWeb, so you view your codepen link on Google chrome, right click those wonky buttons, and select inspect, then right click the button and select :hover https://files.gitter.im/FreeCodeCamp/CodeReview/E8Qm/cap.jpg
Your issue is here... #button:hover
the font-size
Lanitta
@DivaWeb
Feb 25 2016 02:49
@danieldrasdo thanks for the tip. But I am not seeing any errors for this button :(
CamperBot
@camperbot
Feb 25 2016 02:49
divaweb sends brownie points to @danieldrasdo :sparkles: :thumbsup: :sparkles:
:star: 377 | @danieldrasdo | http://www.freecodecamp.com/danieldrasdo
Daniel Drasdo
@danieldrasdo
Feb 25 2016 02:50
Remove the font-size on #button:hover.
Andrew Charlebois
@andrewchar
Feb 25 2016 02:51
is there a "best way" to do an event listener for key strokes in javascript. i have a working jquery listener for enter key but just wanna do it in JS
doing something in a function like " if (13 == e.keyCode)" is this good or bad practise?
Joshua McKenzie
@mckenzieja
Feb 25 2016 02:52
My attempt at Weather API Module
First I pull the location coordinates then I attempt to pull the API info. I feel that this is incorrect but for some reason I cant understand why.
$(document).ready(function(){

  if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(function(position) {
   $.getJSON.("api.openweathermap.org/data/2.5/weather?lat="+position.coords.latitutde+"&lon="+position.coords.longitude+"APPID=7d764d9a5887edcac1258090cce472a8", function(name,main.temp,weather.id,weather.icon)){
              //Pass parameters here to statements that modify html?//
              }

  });
}
Andrew Charlebois
@andrewchar
Feb 25 2016 02:53
@metaljacke1 your function can just be function(json)
@metaljacke1 instead of calling name main temp ect
Bruce Young
@mutantspore
Feb 25 2016 02:54
@metaljacke1 needs http:// in URL
Andrew Charlebois
@andrewchar
Feb 25 2016 02:54
@metaljacke1 there are some syntax errors in your code
@mutantspore still saving the day :P
@mutantspore how ya been
Lanitta
@DivaWeb
Feb 25 2016 02:55
@danieldrasdo thank you
CamperBot
@camperbot
Feb 25 2016 02:55
:warning: divaweb already gave danieldrasdo points
divaweb sends brownie points to @danieldrasdo :sparkles: :thumbsup: :sparkles:
Bruce Young
@mutantspore
Feb 25 2016 02:56
@andrewchar lol good :)
Andrew Charlebois
@andrewchar
Feb 25 2016 02:59
@mutantspore doing my wiki project in pur javascript, you would be proud :P
pure*
Daniel Drasdo
@danieldrasdo
Feb 25 2016 03:00
No worries @DivaWeb
Joshua McKenzie
@mckenzieja
Feb 25 2016 03:01
thanks @andrewchar and @mutantspore but "could" I optionally pass the api parameters rather than all in the (json)?
CamperBot
@camperbot
Feb 25 2016 03:01
metaljacke1 sends brownie points to @andrewchar and @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1164 | @mutantspore | http://www.freecodecamp.com/mutantspore
:star: 321 | @andrewchar | http://www.freecodecamp.com/andrewchar
Andrew Charlebois
@andrewchar
Feb 25 2016 03:03
@metaljacke1 in passing the parameters that you are, i dont believe that you will be able to get the information you need
like actually getting access to the information in the api return object. if you know what i mean
im not good at explaining this as you can see. what i did was pass the json parameter and used that along with dot notation and bracket notation to target what i needed to
Joshua McKenzie
@mckenzieja
Feb 25 2016 03:06
oh like JSON.id or JSON.name am I correct?
I see. I just checked the reference.
Ok cool.
I'll try that thanks a whole bunch @andrewchar
CamperBot
@camperbot
Feb 25 2016 03:07
metaljacke1 sends brownie points to @andrewchar :sparkles: :thumbsup: :sparkles:
:warning: metaljacke1 already gave andrewchar points
Andrew Charlebois
@andrewchar
Feb 25 2016 03:07
no problem!
Joshua McKenzie
@mckenzieja
Feb 25 2016 03:21

So in this function where json is a parameter, could I insert this?

function(json) {
$(#city).html(json.name);
}

Wouldn't this work?

@andrewchar
Im being told it's a syntax error but I've been looking at the documentation online and I cant seem to find any explaining why this particular situation would not work.
Matt Yamamoto
@MattYamamoto
Feb 25 2016 03:23
@metaljacke1 you need quotes in your selector. $('#city')
Joshua McKenzie
@mckenzieja
Feb 25 2016 03:24
faceplam
thanks @MattYamamoto
CamperBot
@camperbot
Feb 25 2016 03:24
metaljacke1 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 925 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Feb 25 2016 03:24
:+1:
Joshua McKenzie
@mckenzieja
Feb 25 2016 03:24
lmao I swear sometimes it's the little things that trip you up.
Andrew Charlebois
@andrewchar
Feb 25 2016 03:24
:)
always those little things we miss
cramjet
@cramjet
Feb 25 2016 03:29
hi folks, i have an issue with one of the basic algorythm scripting problems--is this the place to ask about that or more appropriate in fcc/help?
Bruce Young
@mutantspore
Feb 25 2016 03:29
rooms
CamperBot
@camperbot
Feb 25 2016 03:29

rooms

See all the FreeCodeCamp rooms at gitter.im/FreeCodeCamp/rooms
Or check this wiki article for a shortlist
cramjet
@cramjet
Feb 25 2016 03:31
um, the rooms list seems to list basecamps and things that don't exist anymore?
whoop, i see it now: helpjavascript
Bruce Young
@mutantspore
Feb 25 2016 03:31
:)
cramjet
@cramjet
Feb 25 2016 03:32
thanks, @mutantspore
CamperBot
@camperbot
Feb 25 2016 03:32
cramjet sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1165 | @mutantspore | http://www.freecodecamp.com/mutantspore
Joshua McKenzie
@mckenzieja
Feb 25 2016 03:33
@andrewchar
Shouldn't $("#city".html(json.name); technically set the html element to what the value of that property?
Andrew Charlebois
@andrewchar
Feb 25 2016 03:34
you can use a couple things
.html .text .append
depends what you wanna do
and yes that is what it does
your missing a ) incase you didn't notice
Joshua McKenzie
@mckenzieja
Feb 25 2016 03:35
Well I just want the api to set the html elements, at least changing the basic html element.
yeah typo while typing in here.
Andrew Charlebois
@andrewchar
Feb 25 2016 03:35
just test out .text or .html
one of the two will work for you
Joshua McKenzie
@mckenzieja
Feb 25 2016 03:37
hmm... not doin it.
Lanitta
@DivaWeb
Feb 25 2016 03:38
going to turn in my portfolio please give me feedback for any flaws http://codepen.io/DivaWeb/pen/XXOdEX?editors=1100
Joshua McKenzie
@mckenzieja
Feb 25 2016 03:40
@DivaWeb I think you can add the additional styling (i.e. jquery, bootstrap) by clicking on the cogwheel and the dropdown menu will give you a list to choose from.
Otherwise I think its cool. :smile:
Marek Slabicki
@thaniri
Feb 25 2016 03:41
i'd make the section with the actual information the top
always have your important info above the fold
Lanitta
@DivaWeb
Feb 25 2016 03:43
hey thanks guys
@metaljacke1 @thaniri thanks for looking and the input
CamperBot
@camperbot
Feb 25 2016 03:43
divaweb sends brownie points to @metaljacke1 and @thaniri :sparkles: :thumbsup: :sparkles:
:star: 169 | @thaniri | http://www.freecodecamp.com/thaniri
:star: 280 | @metaljacke1 | http://www.freecodecamp.com/metaljacke1
Marek Slabicki
@thaniri
Feb 25 2016 03:45
for the weather app, can someone take a look at my code? I'm trying to put the longitude and latitude into variables
http://codepen.io/thaniri/pen/jWJWVm
when i open console and type in "var longitude;" after clicking the button
i get undefined
despite the innerHTML working
Joshua McKenzie
@mckenzieja
Feb 25 2016 03:47
@thaniri Im working on the same thing. Guys correct me if Im wrong but since you declared your variable outside of the function, wouldn't the value of your "new" variables be confined to that function?
Marek Slabicki
@thaniri
Feb 25 2016 03:47
that variable is declared in global scope, so any function should be able to access it
Joshua McKenzie
@mckenzieja
Feb 25 2016 03:48
Yeah that's what I was thinking there too but I was unsure of myself.
Marek Slabicki
@thaniri
Feb 25 2016 03:48
@mutantspore what did you change?
Mark Lawrence
@ninja-ml
Feb 25 2016 03:50
hi guys... just finished my Wikipedia Viewer... what do you think?
http://codepen.io/ninja-ml/full/BjMOKz/
Joshua McKenzie
@mckenzieja
Feb 25 2016 03:51
@thaniri looks like he made a change on line 9
Matt Yamamoto
@MattYamamoto
Feb 25 2016 03:51
@thaniri when you say console are you referring to the browsers console or codepen's console? Try it in codepen's console.
Marek Slabicki
@thaniri
Feb 25 2016 03:52
meant browser
Berhong
@berhong
Feb 25 2016 03:52
Hi guys, I just want to ask if there is a way for my img to copy the size of the div within it?
Marek Slabicki
@thaniri
Feb 25 2016 03:53
it doesn't work in codepen's either
Matt Yamamoto
@MattYamamoto
Feb 25 2016 03:53
@thaniri just type in longitude?
Marek Slabicki
@thaniri
Feb 25 2016 03:53
ah, is that javascript syntax for calling variables then?
Bruce Young
@mutantspore
Feb 25 2016 03:53
@thaniri did my change not work for you?
Matt Yamamoto
@MattYamamoto
Feb 25 2016 03:54
@thaniri well var longitude would be declaring the variable again... and since there is no equal to anything it would be undefined
Marek Slabicki
@thaniri
Feb 25 2016 03:54
after @MattYamamoto mentioned that i dont need to type out the whole variable into console
both yours and mine works
thanks @mutantspore @MattYamamoto
CamperBot
@camperbot
Feb 25 2016 03:54
thaniri sends brownie points to @mutantspore and @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 1166 | @mutantspore | http://www.freecodecamp.com/mutantspore
:star: 926 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Laith
@lbustani
Feb 25 2016 03:54
Hi. I am looking for help to understand how to pass constructed/dynamic urls to $.getJSON. I had some success using $.ajax, but it only accepts variables that are pre-defined, not those that are defined by more complex if/lookup statements. From my reading, they recommend using a php or asp file to generate the url, but is there a way to do it purely with javascript? http://codepen.io/lbustani/pen/WwevWR
Matt Yamamoto
@MattYamamoto
Feb 25 2016 03:55
@thaniri further, that won't work in the browser's console, I don't think, because I'm pretty sure that codepen has some wrapping JS so your variables are in the window's scope. I think.
Bruce Young
@mutantspore
Feb 25 2016 03:58
@lbustani where you have data in your ajax you can put all of teh variables you want to pass in your url like units: ‘metric’
ok for getjson @lbustani same sort of thing
// URL for Open Weather Map queries
  var URL = 'http://api.openweathermap.org/data/2.5/weather?';

  // get weather of location
  var parameters = {
    lat: coords[0],
    lon: coords[1],
    units: weatherData.units,
    APPID: OWM_API_KEY
  };

  $.getJSON(URL, parameters)
    .done(function(data, textStatus, jqXHR) {
  stuff here
Laith
@lbustani
Feb 25 2016 04:10
@mutantspore, thanks. Do I understand you correctly? You are saying I can use the post method in the $.ajax call to pass any values I need to append to the url in the same way as an HTML.POST method would? I tried that, but get an "Unauthorized" error result.
CamperBot
@camperbot
Feb 25 2016 04:10
lbustani sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1167 | @mutantspore | http://www.freecodecamp.com/mutantspore
mand0
@mand0
Feb 25 2016 04:11
sup everyone. is it possible to use a wildcard selector in css in combination with the before/after pseudo elements?
i have several div's with "forcast" in the ID name. i can select it like this: [id*="forcast"]
but what if i wanted to add before/after elements to all of them as well?
Bruce Young
@mutantspore
Feb 25 2016 04:12
@lbustani you sent the api key too?
mand0
@mand0
Feb 25 2016 04:12
i'm trying to do something like [id*="forcast"]:after, [id*="forcast"]:before and it's not working
V Arun Kumar
@arunvkumr
Feb 25 2016 04:14
http://codepen.io/arunkumrv/pen/oxvLoN
i'm trying navbar-collapse but it's not working. please help
Laith
@lbustani
Feb 25 2016 04:16
@mutantspore, yes. I included the appid in the data. I am studying your code, and your method seems more elegant. I am going to try again using $.getJSON(URL, parameters) as you have demonstrated. Thanks again.
CamperBot
@camperbot
Feb 25 2016 04:16
lbustani sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: lbustani already gave mutantspore points
Bruce Young
@mutantspore
Feb 25 2016 04:16
@lbustani lol ok i was just making your .ajax work but i’l let you work on
@lbustani also the geolocation is asynchronous (as well as the api call) so you’ll have to wrap the api call in a function and call it from within the geolocate
Laith
@lbustani
Feb 25 2016 04:20
@mutantspore, please continue...if you can fix my $.ajax it will help me understand the solution better. I think the "wrapping" of the function is where I get confused. I wish I could use the async(req, res) waterfall technique here so that it behaved more sequentially.
this is yours …ajax
and don’t shorten the coordinates.. it will be way way off if you do
and it had to be a GET
Laith
@lbustani
Feb 25 2016 04:30
@mutantspore. That helps clear things up tremendously. I had switched to POST in desperation because the documentation mentioned being able to append values to the url, but I see that it works with GET method as you described. I'll sleep better tonight. Thanks again.
CamperBot
@camperbot
Feb 25 2016 04:30
lbustani sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: lbustani already gave mutantspore points
Marek Slabicki
@thaniri
Feb 25 2016 04:41
on the weather app how would i take and navigate through the JSON document from a URL?
http://codepen.io/thaniri/pen/jWJWVm?editors=1011
after the button press the anchor tag allows the user to view the json file of their location
trying to not use jquery
mutantspore @mutantspore trying not t learn js fo rthat lol
Bruce Young
@mutantspore
Feb 25 2016 04:44
well maybe
Marek Slabicki
@thaniri
Feb 25 2016 04:45
the only thing i could google was http://www.w3schools.com/json/json_http.asp
which shows how to get something from a .txt
in propery array format
however with the openweather API the json file starts with { and not [
Catalin Scripcariu
@CatalinScr
Feb 25 2016 04:45
Hi, I just finish my Wikipedia Search. Any feedback:
http://codepen.io/CatalinScr/full/ZQdWRj/
Rory Avant
@roryavant8
Feb 25 2016 04:59
Hey everyone. Check out my Tribute Page and let me know what you think! http://codepen.io/roryavant8/pen/PZvvab
Berhong
@berhong
Feb 25 2016 05:00
is there anyway i can stretch the width of my text? with just HTML and CSS?
Marek Slabicki
@thaniri
Feb 25 2016 05:00
your layout breaks on the second earth icon
on mousehover
try this berhong
Berhong
@berhong
Feb 25 2016 05:01
ill check it out
Bruce Young
@mutantspore
Feb 25 2016 05:06
@thaniri ok well here it is using JS to get the weather. I have cleaned few things up also
@thaniri the Temperature is in Kelvin
Marek Slabicki
@thaniri
Feb 25 2016 05:08
gotcha
1 simple question
when i look at the URL and ctrl+f "main"
i get 2 results
SuhasHosamani
@SuhasHosamani
Feb 25 2016 05:08
Hi everyone, good morning :smile: can you please review this www.hosamani.tk
It would be of great help :smile:
Marek Slabicki
@thaniri
Feb 25 2016 05:09
when oyu call weatherData.main.temp
shouldn't it be weather.main.temp
where is data coming from
Bruce Young
@mutantspore
Feb 25 2016 05:11
no that’s another object. I called all the data returned weatherData. it’s now a json object holding everything
Marek Slabicki
@thaniri
Feb 25 2016 05:12
brilliant, thanks a million @mutantspore
CamperBot
@camperbot
Feb 25 2016 05:12
thaniri sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1168 | @mutantspore | http://www.freecodecamp.com/mutantspore
Bruce Young
@mutantspore
Feb 25 2016 05:13
weather is an object containg an array of one element. you wil need to deal with that to get the description etc
Marek Slabicki
@thaniri
Feb 25 2016 05:13
yeah at this point all i need to do is navigate the json object you've made
Eduardo Garcia
@eagarcia8
Feb 25 2016 05:48
Hi guys, can I get some help with a JSON request?
I'm having some trouble getting some data from a JSON request. The link http://quotes.stormconsultancy.co.uk/random.json is valid JSON according to jsonlint.com but when I execute a $.getJSON I get the error: No Access-Control-Allow-Origin header is present on the requested resource. and if I request it as jsonp I get the error Uncaught SyntaxError: Unexpected token : BUT there is the correct data when I click on the link in the console. How can I get that data to be read correctly?
Harvey S
@harveysanders
Feb 25 2016 06:01
@eagarcia8 are you developing locally or are you on c9?
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:03
@harveysanders I'm using codepen.io
Bruce Young
@mutantspore
Feb 25 2016 06:03
@eagarcia8 i had a fiddle with that a few days ago trying to help someone. Normally you’d use a callback function but there are no useful docs for that api
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:05
It returns a JSON object, doesn't seem complicated in understanding the returned data, but then I'm new to JSON
Caleb Martin
@caleb272
Feb 25 2016 06:06
anyone want to check out my wiki search project for FCC http://codepen.io/thecoder15/full/grYOdW?editors=0100
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:06
From my experience Uncaught Syntax Error just means that the JSON object is malformed (which doesn't look like it), or jQuery is misunderstanding something its receiving.
Also if jsonlint.com can request it without errors then its something else
Bruce Young
@mutantspore
Feb 25 2016 06:09
the initial error is a cross domain issue. the api doesn’t really give any info on how to work with that. normally I’d tack on ?callback=? or something similar but that then gives the second error you mention
Amir Ghafouri
@amirghafouri
Feb 25 2016 06:09
Any advice on the best approach to celsius/farenheit toggle for the weather app?
What I have right now works but I suspect it's horribly inefficient(?)http://codepen.io/amirghafouri/pen/WweNEX?editors=0010
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:12
@mutantspore Yea callback actually gets the data, but I think jQuery is confused on what it received, I wonder if there is a way to ignore the error and receive it just as text and then I can create a function to extract the data from the string that looks like a JSON object.
Harvey S
@harveysanders
Feb 25 2016 06:13
anyone use babel-loader with webpack?
Bruce Young
@mutantspore
Feb 25 2016 06:13
@harveysanders try the datavis room
rooms
CamperBot
@camperbot
Feb 25 2016 06:13

rooms

See all the FreeCodeCamp rooms at gitter.im/FreeCodeCamp/rooms
Or check this wiki article for a shortlist
Maulik Darji
@maulikdarji
Feb 25 2016 06:14
@amirghafouri Instead of making API call again, you can covert Celsius into Fahrenheit with this: Fahrenheit = Celsius * 9/5 +32 or Vice-versa.
fluffystub
@RakshithNM
Feb 25 2016 06:15
@JackEdwardLyons thank you
CamperBot
@camperbot
Feb 25 2016 06:15
rakshithnm sends brownie points to @jackedwardlyons :sparkles: :thumbsup: :sparkles:
:star: 283 | @jackedwardlyons | http://www.freecodecamp.com/jackedwardlyons
Harvey S
@harveysanders
Feb 25 2016 06:16
@eagarcia8 so you’re not getting any data back from the request?
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:18
@harveysanders According to console, I am but jQuery gets stuck because it throws a syntax "error".
Maybe somehow jQuery isn't expecting a JSON object?
Harvey S
@harveysanders
Feb 25 2016 06:18
ah maybe
one sec
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:19
@harveysanders As far as I know normal JSON doesn't work, but jsonp does, but maybe jQuery is expecting jsonp but the server returns JSON when requesting jsonp
Don't really know the difference between JSON and jsonp
Harvey S
@harveysanders
Feb 25 2016 06:20
yeah you might be about to do $.ajax({ dataType: "jsonp", url: url, data: data, success: success });
i gotta check the docs
i vaguely remember having an issue like this
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:21
@harveysanders You can check out my current code: http://codepen.io/eagarcia/pen/BKBKVN?editors=0010
Although look at JS
Harvey S
@harveysanders
Feb 25 2016 06:21
jsonp is kind of a bootleg JSON string that comes back like a URL to get around the cross-origin issue
from what i understand
it doesn’t look like an normal JSON object
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:21
@harveysanders Yea and it works, but maybe jQuery is confused expecting jsonp but still getting JSON
Harvey S
@harveysanders
Feb 25 2016 06:22
@eagarcia8 the function all i just sent you works?
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:23
The response is {"author":"Larry DeLuca","id":37,"quote":"I\u2019ve noticed lately that the paranoid fear of computers becoming intelligent and taking over the world has almost entirely disappeared from the common culture. Near as I can tell, this coincides with the release of MS-DOS.","permalink":"http://quotes.stormconsultancy.co.uk/quotes/37"} which looks like a JSON object.
No, the "syntax" error is all of the the response
So I'm guessing jQuery is not expecting a JSON object, if its highlighting the whole object as an error.
OOH I think I know whats going on. Requesting jsonp is returning a LINK, which actually has the data, is it possible to use that link to get to the data?
I think it might be easier reading it as HTML instead of JSON, is it possible to request raw HTML using jQuery?
Harvey S
@harveysanders
Feb 25 2016 06:29
yeah thats what i meant becomes back as a URL. I think so
let me look though some stuff
Michael Poutre
@M1kep
Feb 25 2016 06:30
Blegh, I still have to maake portfiol page or someting
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:31
What I'm thinking is avoid a JSON request and just do an "HTML" request, parse through it to get to the string and convert that to an array.
Michael Poutre
@M1kep
Feb 25 2016 06:31
@eagarcia8 but isnt that just a wast of processing and bandwidth?
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:31
@M1kep What do you mean?
Tim Signore
@Timsig
Feb 25 2016 06:32
Hey @eagarcia8 and @harveysanders , I think I may be experiencing the same problem. I'm trying to get a response from this API http://forismatic.com/en/api/ using $get, but no dice. Are you saying that the response has to be in jsonp format to work?
Harvey S
@harveysanders
Feb 25 2016 06:32
you should just be able to do a jsonp request, explicitly add your callback function to the GET request url and process the data with that callback
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:33
@harveysanders I wouldn't know how to do what you just said haha.
New to JSON btw.
Michael Poutre
@M1kep
Feb 25 2016 06:33
@Timsig Idk but this may help you? http://api.forismatic.com/api/tester/
It says it supports formats other than JSONP
Harvey S
@harveysanders
Feb 25 2016 06:34
jQuery.getJSON(url+"&callback=?", function(data) { alert("Symbol: " + data.symbol + ", Price: " + data.price); });
something like that more or less
is there some way you can share your code?
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:35
@harveysanders me?
I'm currently looking how I can receive HTML using jQuery.
Looks like jQuery.load() might be an option
Harvey S
@harveysanders
Feb 25 2016 06:37
@eagarcia8 yeah sorry
Tim Signore
@Timsig
Feb 25 2016 06:38
Thanks @M1kep , it works in the tester (returns a quote as JSON), but my code gets no response:
$.getJSON({
  url: "http://api.forismatic.com/api/1.0/",
  data:{method: 'getQuote',
         // key:457653,
        format: 'json',
        lang: 'eng'
        },
  success: function(response){
    alert("Data loaded");
    console.log(response);
  }
CamperBot
@camperbot
Feb 25 2016 06:38
timsig sends brownie points to @m1kep :sparkles: :thumbsup: :sparkles:
:star: 296 | @m1kep | http://www.freecodecamp.com/m1kep
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:41
@harveysanders $.load doesn't work getting the no cross domain error.
Bruce Young
@mutantspore
Feb 25 2016 06:43
@Timsig thecode looks like a $.ajax call rather than a $.getJSON
Tim Signore
@Timsig
Feb 25 2016 06:45
@mutantspore , I know, but even if i change it to just $get. (which is shorthand for .ajax), I still get no response.
Bruce Young
@mutantspore
Feb 25 2016 06:45
@Timsig can we see it?
Karter
@Krter
Feb 25 2016 06:46
Hi ppl from where I can get the best interview question on front end like HTML5, CSS3,JQUERY,JS
It would be helpful for me to focus on different strategy of learning and as i'm in panel It's better for me
Harvey S
@harveysanders
Feb 25 2016 06:50
@eagarcia8
oh man!
damn ampersand
when you pass parameters with URLs you need to use & like so "http://quotes.stormconsultancy.co.uk/random.json&callback=?"
between json & callback
instead of json?callback=…
@eagarcia8 sorry took so long to find that
Sangeetha
@manmarziyan
Feb 25 2016 06:53
I'm working on a tweet button, random quote machine. Any idea why the link doesn't change?
Harvey S
@harveysanders
Feb 25 2016 06:53
@eagarcia8 http://quotes.stormconsultancy.co.uk/random.json is the base of the URI and callback=? is a parameter for the request. they need to be separated by & not ?
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:54
@harveysanders just tested it! it works!
Harvey S
@harveysanders
Feb 25 2016 06:55
@eagarcia8 sweet! i should’ve been quicker on that one. i need to go to bed
@eagarcia8 good luck with the rest man
Eduardo Garcia
@eagarcia8
Feb 25 2016 06:55
@eagarcia8 Okay so the error was that people were putting ?callback=? instead of &callback=?.... PHP should of kicked in lol
@harveysanders Thanks man, can get to work again.
CamperBot
@camperbot
Feb 25 2016 06:56
eagarcia8 sends brownie points to @harveysanders :sparkles: :thumbsup: :sparkles:
:star: 372 | @harveysanders | http://www.freecodecamp.com/harveysanders
Harvey S
@harveysanders
Feb 25 2016 06:56
no problem
hah
Richard Corbett
@reacorbett
Feb 25 2016 06:58
@harveysanders nice
Amir Ghafouri
@amirghafouri
Feb 25 2016 07:04
How do I pull this off?
$("#someElement").html($("#someElement" )* 3);
Eduardo Garcia
@eagarcia8
Feb 25 2016 07:05
@amirghafouri You might want to get the HTML in #someElement into a variable, and then use that variable to multiply by 3
Amir Ghafouri
@amirghafouri
Feb 25 2016 07:06
@eagarcia8 how do I extract the contents? Because var someElement = $("#someElement").html() doesn't work right?
Bruce Young
@mutantspore
Feb 25 2016 07:07
@amirghafouri how did it get into the element in the first place? isn’t that a point you could deal with it
Eduardo Garcia
@eagarcia8
Feb 25 2016 07:07
@amirghafouri use .html()
Amir Ghafouri
@amirghafouri
Feb 25 2016 07:08
so what I had there does work? I thought it would just empty the html element?
Bruce Young
@mutantspore
Feb 25 2016 07:08
what I’m saying is that you shouldn’t be using teh DOM to store stuff.. it’ sfor presenting stuff
Eduardo Garcia
@eagarcia8
Feb 25 2016 07:08
@amirghafouri Probably the reason it doesn't work is because Javascript is trying to multiply 3 with a string. converting to a variable should fix that.
@amirghafouri What are you getting with $("#someElement").html()
console.log it
Amir Ghafouri
@amirghafouri
Feb 25 2016 07:11
I was trying and console.log didn't work on codepen for me
Eduardo Garcia
@eagarcia8
Feb 25 2016 07:11
.html() gets what currently there and .html("") sets whatever you put between the quotes.
Amir Ghafouri
@amirghafouri
Feb 25 2016 07:11
I imagine I'm not getting anything and it just changes the contents of #someElement to whatever is in the brackets, so in this case nothing
ohhhhhh
that's exactly the answer I was looking for
Eduardo Garcia
@eagarcia8
Feb 25 2016 07:11
.html is get set, used correctly
Sloth
@RMo-Sloth
Feb 25 2016 07:12
Anywhere I can see other people's freeCodeCamp portfolio?
Amir Ghafouri
@amirghafouri
Feb 25 2016 07:12
v helpful thanks @eagarcia8
CamperBot
@camperbot
Feb 25 2016 07:12
amirghafouri sends brownie points to @eagarcia8 :sparkles: :thumbsup: :sparkles:
Karter
@Krter
Feb 25 2016 07:12
Hi any one can help on my request
CamperBot
@camperbot
Feb 25 2016 07:12
:star: 286 | @eagarcia8 | http://www.freecodecamp.com/eagarcia8
Eduardo Garcia
@eagarcia8
Feb 25 2016 07:12
np
Michael Poutre
@M1kep
Feb 25 2016 07:13
@Timsig did you ever figure it out?
Michael Poutre
@M1kep
Feb 25 2016 07:19

Well @Timsig this is the issue im runing into trying to get it to work:

testing.html:1 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 'http://testing123-kepkep.c9users.io' is therefore not allowed access.

Ankit Panwar
@coderNoob
Feb 25 2016 07:20
In Symmetric Difference Bonfire, the sym function only accepts a single parameter but there are n number of arguments being passed. How ? I don't get it.
That should help you :)
Ankit Panwar
@coderNoob
Feb 25 2016 07:25
@M1kep Thanks
CamperBot
@camperbot
Feb 25 2016 07:25
codernoob sends brownie points to @m1kep :sparkles: :thumbsup: :sparkles:
:star: 297 | @m1kep | http://www.freecodecamp.com/m1kep
Michael Poutre
@M1kep
Feb 25 2016 07:26
Np, took me a min to figure it out too :P
Michael Poutre
@M1kep
Feb 25 2016 07:41
Heeeeey @Timsig you still there?

After some more research i've found the site is just finicky, so your forced to use either JSONP or a CORS proxy like :

https://crossorigin.me/

So it'd become
I changed it cuase the way you had it confused me, I just remove the object inside of the getJSON call and just filled out the arguments it asked for with the same info
$(document).ready(function() {
  $.getJSON("http://crossorigin.me/http://api.forismatic.com/api/1.0/", {
    method: 'getQuote',
    format: 'json',
    lang: 'en',
  }, function(response) {
    alert(response);
  });

});
Nisha Shlaymoon
@leaguelism
Feb 25 2016 08:20
Hey guys, I'm starting my random quote machine tomorrow. Any tips on how to start or tackle the challenge? I have no clue how to start haha
Caleb Martin
@caleb272
Feb 25 2016 08:21
start with the style then move to the JS^
once you get started you will know what to do
Nisha Shlaymoon
@leaguelism
Feb 25 2016 08:22
is it mostly ajax?
cause I've stormed through the json apis challenge but i still am not sure what to use in terms or js
Caleb Martin
@caleb272
Feb 25 2016 08:22
it depends you can use an api or just make a array of quotes
Nisha Shlaymoon
@leaguelism
Feb 25 2016 08:23
ah I see
Thank you @ caleb272 I have to head to sleep now
Gn everyone!
Caleb Martin
@caleb272
Feb 25 2016 08:23
by
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 08:30
im having a litle trouble with the javascript challenges
i just dont understand what i'm supposed to do on this one
kirbyedy
@kirbyedy
Feb 25 2016 08:33
?
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 08:35
its the word blanks challenge
i dont understand what im supposed to do
anthonygallina1
@anthonygallina1
Feb 25 2016 09:02
?
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 09:02
nvm...i figured it out
anthonygallina1
@anthonygallina1
Feb 25 2016 09:03
Good job
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 09:03
ive had more issue with this so far han anything else
Yuvraj Adagale
@Yuvraj1989
Feb 25 2016 09:46
can anyone please tell me how to start " Build a Random Quote Machine Task".?
Caleb Martin
@caleb272
Feb 25 2016 09:46
with code my friend with code ^
hey Rogue00 hows it going
Yuvraj Adagale
@Yuvraj1989
Feb 25 2016 09:47
@caleb272 exactly the answer I was expecting
Caleb Martin
@caleb272
Feb 25 2016 09:48
haha
what else could you expect
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 09:49
heyas @caleb272 im struggling through the javascript challenges
Yuvraj Adagale
@Yuvraj1989
Feb 25 2016 09:49
@caleb272 some help
hahaahha
Caleb Martin
@caleb272
Feb 25 2016 09:49
rogue what ones
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 09:50
the hard ones :P
Caleb Martin
@caleb272
Feb 25 2016 09:50
haha coding is all about problem solving @Yuvraj1989
well if you have the code you are stuck on i can help you
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 09:51
i'm not stuck atm but ive completed a few that i really just dont understand how they work
Yuvraj Adagale
@Yuvraj1989
Feb 25 2016 09:51
@caleb272 i m yet to start on that task
just googling now
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 09:58
ive broken 200 challenges
Caleb Martin
@caleb272
Feb 25 2016 09:58
nice I’m at 286 you really slow down when you get to the projects
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 09:58
yea..well...i havent finished my portfolio
im going to need to rethink it maybe....
Chris Hinton
@hintcj
Feb 25 2016 09:59
Does anyone have any advice on quickly finding closing div tags when using code pen?
Coy Sanders
@coymeetsworld
Feb 25 2016 10:01
@hintcj when you create a div tag, or any tag actually you should also create the closing one with it
that way you'll never forget it, also indenting helps for readability
Chris Hinton
@hintcj
Feb 25 2016 10:03
@coymeetsworld I usually do but when I start changing and deleting things, I start getting a little lost trying to figure out if I've closed one or accidentally put it inside another div (which has happened more times than I'd like to admit)
Ashraful Islam
@iashraful
Feb 25 2016 10:03
hello!
Coy Sanders
@coymeetsworld
Feb 25 2016 10:03
then that's where indenting helps
and another thing i do if the code is real long
on the closing tags on the bottom I put a comment on the same line with the opening tag
let me find an example of what i did
    </div> <!-- div class="row" id="header" -->
  </div> <!-- div class="container-fluid" -->
</body>
something like that
Chris Hinton
@hintcj
Feb 25 2016 10:06
Okay, that makes sense. That's an awesome idea that I'm going to steal. Thanks for the help/advice @coymeetsworld
CamperBot
@camperbot
Feb 25 2016 10:06
hintcj sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 305 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
Feb 25 2016 10:07
lol np @hintcj
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 10:09
i'm getting through the challenges but bleh...taking me a minute to figure some of them out
I dont think i could write any recognizeable strings or arrays without looking back
vichus1995
@vichus1995
Feb 25 2016 10:33
hey guys.just started the weather app zipline and am currently trying to display the city name.can someone help me, i'm new to API's.
$(document).ready(function(){

if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(function(position) {

  $.getJSON(  "http://api.openweathermap.org/data/2.5/weather?lat="+position.coords.latitude+"&lon="+position.coords.longitude+"&APPID=49d8540f04ac88d86361294f821fd780",function(JSON) {

    $('#city').html(JSON.name); 
            });
  });
  }
});
Coy Sanders
@coymeetsworld
Feb 25 2016 10:35
@vichus1995 I'm working through this zipline too, you have to parse the data you get from the getJSON command
review the JSON API and Ajax challenges
vichus1995
@vichus1995
Feb 25 2016 10:40
thanks @coymeetsworld
CamperBot
@camperbot
Feb 25 2016 10:40
vichus1995 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 308 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
Feb 25 2016 10:45
np
Avadhut Mainkar
@Avadhut13
Feb 25 2016 10:46
@coymeetsworld but can't we just use stringify to display the data in page ?Just like they did in the challange?
@coymeetsworld because i am stuck at the same thing.
Coy Sanders
@coymeetsworld
Feb 25 2016 10:49
stringify prints the entire output of the JSON data @Avadhut13
but you don't want that, you want to parse it out and take the parts you want to use
and also display it all pretty :)
Avadhut Mainkar
@Avadhut13
Feb 25 2016 10:51
@coymeetsworld I know,but i wanted to confirm that i am getting the data from api , so i tried to display it using stringify,but it is not working..
Coy Sanders
@coymeetsworld
Feb 25 2016 10:51
code? @Avadhut13
i can take a look at it I've gotten at least that far
Avadhut Mainkar
@Avadhut13
Feb 25 2016 10:52
@coymeetsworld
var lat;
var lon;
var url="";
function getLongLat(){
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
lat=position.coords.latitude;
lon=position.coords.longitude;
$("#lat").html(lat);
$("#long").html(lon);
});
}
}
$(document).ready(function(){
$("#head").on("click",function(){
getLongLat();
url="api.openweathermap.org/data/2.5/weather?"+"lat="+lat+"&lon="+lon+"&appid=82b0d25a21621e3bf1bd34f06ec78809";;
$.getJSON("url",function(json){
$("#show").html(JSON.stringify(json));
});
});
});
Coy Sanders
@coymeetsworld
Feb 25 2016 10:53
in getJSON url shouldn't be in quotes
also I think you should wrap everything in the $(document).ready(function() just to be safe
Avadhut Mainkar
@Avadhut13
Feb 25 2016 10:55
@coymeetsworld I removed the quotes,still not working..
Coy Sanders
@coymeetsworld
Feb 25 2016 10:55
you need to also specify the protocol in the url (i.e. http://)
getJSON makes a GET request to a server
Avadhut Mainkar
@Avadhut13
Feb 25 2016 10:56
@coymeetsworld how can i do it?
you don't need to type in the http part in the browser because the browser will do that for you automatically, getJSON won't
Avadhut Mainkar
@Avadhut13
Feb 25 2016 10:56
@coymeetsworld oh.. okay!let me try that.thnx!
CamperBot
@camperbot
Feb 25 2016 10:56
avadhut13 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 309 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
Feb 25 2016 10:57
np, you get that to work you're as far as I am lol
Avadhut Mainkar
@Avadhut13
Feb 25 2016 10:59
@coymeetsworld IT'S WORKING!! THNX AGAIN!
CamperBot
@camperbot
Feb 25 2016 10:59
avadhut13 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:warning: avadhut13 already gave coymeetsworld points
Coy Sanders
@coymeetsworld
Feb 25 2016 10:59
np :thumbsup: @Avadhut13
vichus1995
@vichus1995
Feb 25 2016 11:12
i'm also trying to confirm getting the data from the api,but still not working
$(document).ready(function(){
 $("#getcity").on("click",function() {
if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(function(position) {

  $.getJSON(  "http://api.openweathermap.org/data/2.5/weather?lat="+position.coords.latitude+"&lon="+position.coords.longitude+"&appid=49d8540f04ac88d86361294f821fd780",function(myjson) {

    $('#city').html(JSON.stringify(myjson)); 
            });
  });
}
});
});
Avadhut Mainkar
@Avadhut13
Feb 25 2016 11:14
@vichus1995 try using json instead of myjson
Coy Sanders
@coymeetsworld
Feb 25 2016 11:15
no myjson is right
try putting the url in a variable, and print out the url in console.log
see if it's making the right url first
Ian
@Pyrothraxis
Feb 25 2016 11:25
Wondering if anyone can help/advise me. I'm currently doing the Random Quote Generator and I'm recieving an error. In the console:
"This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1"
http://codepen.io/Pyrothraxis/pen/dGxEea <- My pen with code as a reference
vichus1995
@vichus1995
Feb 25 2016 11:27
@coymeetsworld where do you get the console.log output?
Coy Sanders
@coymeetsworld
Feb 25 2016 11:29
its a function
used for debugging
vichus1995
@vichus1995
Feb 25 2016 11:32
i used it.but where do i get it's output in codepen?
h4r1m4u
@h4r1m4u
Feb 25 2016 11:41
@Pyrothraxis change the 'header' to 'beforeSend' like so
    $.ajax({
      //dataType: "json", 
      url: "https://andruxnet-random-famous-quotes.p.mashape.com/?cat=movies",
      beforeSend: function(xhr) {
          xhr.setRequestHeader("X-Mashape-Authorization", "KQlIwtvQUVmshWpZVTfXYyjNTnPHp1pozqcjsnymY95Z6ZiP0S"); 
      },
      success: ...
the rest of your code is fine
@vichus1995 either click on the 'Console' button (which which should be at the bottom of your preview pane, next to Embed, Comments, etc.) or use your browser's console directly (https://developer.chrome.com/devtools/docs/console)
Richard Andrews
@Whiplash5057
Feb 25 2016 12:15
Hey guys need some help...!!! Problem in obtaining the 2nd element of the json.weather main
http://codepen.io/Whiplash5057/pen/ZWzBBL
Radhika Chaudhary
@radheyIndia
Feb 25 2016 12:16
I am stuck in this "Sum all numbers in range"
help me please
here is my code
I Cannot understand how to use array.reduce
function sumAll(arr) {
  var a=Math.min(arr);
  var b=Math.max(arr);


  function sum(a,b)
 {
   return a+b;

 }
 return arr.reduce(sum,a,b);
}

sumAll([1, 4]);
h4r1m4u
@h4r1m4u
Feb 25 2016 12:21
@Whiplash5057 why are you calling the API 4 times? once you call it once and successfully receive the response, you can do whatever you need to do with the data in one go
Richard Andrews
@Whiplash5057
Feb 25 2016 12:22
@h4r1m4u wait lemme try that!!!
I changed It .. @h4r1m4u
h4r1m4u
@h4r1m4u
Feb 25 2016 12:25

@radheyIndia you issue is in these two lines:

  var a=Math.min(arr);
  var b=Math.max(arr);

the min and max functions take numbers as parameters, but you're feeding them an array.
will arr always have the smaller number as the first element or can it come 2nd in the array?

Richard Andrews
@Whiplash5057
Feb 25 2016 12:26
@h4r1m4u I don't know how to use the icons that openweathermap.org provides .....!!!
Could you help me ??
h4r1m4u
@h4r1m4u
Feb 25 2016 12:26
@Whiplash5057 ok. so which of the weather object properties are you having trouble accessing?
just the icon?
Richard Andrews
@Whiplash5057
Feb 25 2016 12:27
Yes ...!!
I wanna use ajax to add it to my html
Radhika Chaudhary
@radheyIndia
Feb 25 2016 12:28
how should I pass the values in Math.min() .
They will be changed when we will call the function by another array @h4r1m4u
Richard Andrews
@Whiplash5057
Feb 25 2016 12:28
but I don' know which tag should i put it into
@h4r1m4u should i put it in an <img> tag ???
h4r1m4u
@h4r1m4u
Feb 25 2016 12:30
@Whiplash5057 correct. it gives you only the image name. you need to add the main weatheropen URL as well as the icon image extension (.png):
      var icon = '<img src="http://openweathermap.org/img/w/' + json.weather[0].icon + '.png">';
      $("#description").append(icon);
@radheyIndia will the array be always sorted? i.e. will the smaller number always come first in the array or not?
Radhika Chaudhary
@radheyIndia
Feb 25 2016 12:31
no its not
@h4r1m4u
Richard Andrews
@Whiplash5057
Feb 25 2016 12:32
@h4r1m4u AWESOMENESSS!!!!Thanks
CamperBot
@camperbot
Feb 25 2016 12:32
whiplash5057 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1482 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Feb 25 2016 12:32
@radheyIndia in that case you can do this:
  var a=Math.min(arr[0], arr[1]);
  var b=Math.max(arr[0], arr[1]);
Radhika Chaudhary
@radheyIndia
Feb 25 2016 12:32
ok let me give it a try @h4r1m4u
h4r1m4u
@h4r1m4u
Feb 25 2016 12:33
the min/max functions take numbers, separated by commas, as arguments. so instead of the entire array, we feed them the individual elements
@Whiplash5057 yw
Richard Andrews
@Whiplash5057
Feb 25 2016 12:40
@h4r1m4u In which unit is the temperature ...? cause my temperature is showing 299.078
h4r1m4u
@h4r1m4u
Feb 25 2016 12:41
kelvin. you need to convert it
Richard Andrews
@Whiplash5057
Feb 25 2016 12:41
@h4r1m4u OK
cool cool
@h4r1m4u 1 last doubt ...how can I make that icon bigger ??
Can I??
h4r1m4u
@h4r1m4u
Feb 25 2016 12:45
you could set a width attribute on it in your CSS. but it'll lose some of its quality and look pixelated
Richard Andrews
@Whiplash5057
Feb 25 2016 12:46
@h4r1m4u lemme try ...!!
kirbyedy
@kirbyedy
Feb 25 2016 12:46
or you try to use other icons
Radhika Chaudhary
@radheyIndia
Feb 25 2016 12:47
oh @h4r1m4u its working but the question is to print the sum of all numbers in the range of first and second element of array
h4r1m4u
@h4r1m4u
Feb 25 2016 12:48
which is what your sumAll() function will do once you've modified the two lines
Richard Andrews
@Whiplash5057
Feb 25 2016 12:49
@kirbyedy thanks i'll try that too
CamperBot
@camperbot
Feb 25 2016 12:49
whiplash5057 sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 540 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
h4r1m4u
@h4r1m4u
Feb 25 2016 12:50
oh hang on, it won't. you'll need to generate all the numbers in the range between your a and b. you can use a forloop for that
Tim Signore
@Timsig
Feb 25 2016 12:56
Thanks heaps @M1kep I will give that a go; much appreciated
CamperBot
@camperbot
Feb 25 2016 12:56
timsig sends brownie points to @m1kep :sparkles: :thumbsup: :sparkles:
:star: 301 | @m1kep | http://www.freecodecamp.com/m1kep
Thabani Manzini
@ThabaniM
Feb 25 2016 13:00
hey is anyone familiar with this error XMLHttpRequest cannot load https://en.wikipedia.org/w/api.php?action=opensearch&search=gift&limit=10&namespace=0&format=json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access.
kirbyedy
@kirbyedy
Feb 25 2016 13:08
cross origin is it
use callback=?
Thabani Manzini
@ThabaniM
Feb 25 2016 13:27
thank you @kirbyedy I'll take a look although it looks like chinese atm
CamperBot
@camperbot
Feb 25 2016 13:27
thabanim sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 541 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
Ashraful Islam
@iashraful
Feb 25 2016 13:29
@ThabaniM
url = "https://en.wikipedia.org/w/api.php?action=opensearch&search=" + query + &limit=10&namespace=0&format=json&callback=?";
Thabani Manzini
@ThabaniM
Feb 25 2016 13:30
@iashraful dont tell me that I just have to do that to get it to work
anthonygallina1
@anthonygallina1
Feb 25 2016 13:32
;)
Thabani Manzini
@ThabaniM
Feb 25 2016 13:38
error is gone somehow thanks for clearing that up @iashraful
CamperBot
@camperbot
Feb 25 2016 13:38
thabanim sends brownie points to @iashraful :sparkles: :thumbsup: :sparkles:
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 13:38
bleh
CamperBot
@camperbot
Feb 25 2016 13:38
:star: 457 | @iashraful | http://www.freecodecamp.com/iashraful
kirbyedy
@kirbyedy
Feb 25 2016 13:46
:palm_tree:
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 13:46
basic javascript is giving me a helluva time
i know im smart but im starting to feel like a retard
kirbyedy
@kirbyedy
Feb 25 2016 13:48
just take it easy
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 13:48
some of its gone pretty easy but some i just cant seem to understand...missing something or another
Alex
@Jeckstex
Feb 25 2016 13:49
Hello campers! :) I am working on the "Wheather App" Project. I have found a way to get the latitude and the longitude of my position. Now I would like to use them to know the weather thanks to http://openweathermap.org/current#geo.
The problem is that I am not able to get the information I want from the API that is in the link:
http://api.openweathermap.org/data/2.5/weather?lat=35&lon=139&appid=44db6a862fba0b067b1930da0d769e98">api.openweathermap.org/data/2.5/weather?lat=35&lon=139
Could one of you give me a hand please?
vichus1995
@vichus1995
Feb 25 2016 13:51
guys,i'm doing the weather app zipline and just trying to confirm whether i was getting the data from the api,but apparently i'm not.could someone please hep me?
 $("#getcity").on("click",function() {

if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(function(position) {

       var url=  "http://api.openweathermap.org/data/2.5/weather?lat="+position.coords.latitude+"&lon="+position.coords.longitude+"&appid=49d8540f04ac88d86361294f821fd780";

  $.getJSON(url,function(myjson) {

    $("#city").html(JSON.stringify(myjson)); 
            });
  });
}
});
});
Matthew Boland
@mattboland
Feb 25 2016 13:51
@Jeckstex you have two url's there. which one are you trying?
kirbyedy
@kirbyedy
Feb 25 2016 13:52
@Jeckstex I think your link is a bit wrong
Matthew Boland
@mattboland
Feb 25 2016 13:52
@Jeckstex do you see where the " is? that's the end of your link, the rest is not necessary
kirbyedy
@kirbyedy
Feb 25 2016 13:53
that should work
now you just need to replace that lat and lon with users location
João Porfírio
@pixelparker
Feb 25 2016 13:54
Hey guys, anyone willing to mentor a poor soul in HTML/CSS?
Alex
@Jeckstex
Feb 25 2016 13:55
@kirbyedy yes, I know how to do this in Javascript. The problem is that I would like to stock this info in a variable or something to be able to use it. But I don't know how to do so.
I did: y.innerHTML = "http://api.openweathermap.org/data/2.5/weather?lat=" + position.coords.latitude + "&lon=" + position.coords.longitude + "&appid=44db6a862fba0b067b1930da0d769e98";
M. Kepler
@Missarachnid
Feb 25 2016 14:02
@Rogue00 We have all felt that way! What part of Javascript are you having a problem with?
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 14:03
right now im having trouble with selecting from many options with switch statements
im unclear on which statements to use
vichus1995
@vichus1995
Feb 25 2016 14:04
guys,i'm doing the weather app zipline and just trying to confirm whether i was getting the data from the api,but apparently i'm not.could someone please help me?
$(document).ready(function(){
 $("#getcity").on("click",function() {

if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(function(position) {

       var url=  "http://api.openweathermap.org/data/2.5/weather?lat="+position.coords.latitude+"&lon="+position.coords.longitude+"&appid=49d8540f04ac88d86361294f821fd780";

  $.getJSON(url,function(myjson) {

    $("#city").html(JSON.stringify(myjson)); 
            });
  });
}
});
});
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 14:05
when i google it i get different statements that in the challenge...seems like ive tried everything...I know im ding something wrong and its probably obvious...my brain just doesnt seem like like javascript :(
kirbyedy
@kirbyedy
Feb 25 2016 14:06
@vichus1995 link your pen
M. Kepler
@Missarachnid
Feb 25 2016 14:07
Wish I could help you. I have been studying JS for 7months teamtreehouse, and just started here a few days ago. I took a workshop with them and they sprung it up all of the sudden, didn't mention it in an earlier class at all. I am new to that too. Don't give up. If I use google and it doesn't work, I usually do a direct search through stackoverflow.
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 14:08

function myTest(val) {
var answer = "";
// Only change code below this line
switch (answer) {
case 1:
answer = ("alpha");
break;
case 2:
answer = ("beta");
break;
case 3:
answer = ("gamma");
break;
case 4:
answer = ("delta");

}

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

what am i doing wrong here?
Omran Abazid
@OmranAbazid
Feb 25 2016 14:10
@Rogue00 switch(val) {
George Carroll
@ghcarrolljr
Feb 25 2016 14:10
for some reason I can not change the background color of the tag area "allData". can anyone help. The "data2" and "data3" will change. any suggestions?
background-color:gray;
oops will send copy
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 14:11
im sure ive tried that
.>
George Carroll
@ghcarrolljr
Feb 25 2016 14:11

<div id="row" class"row col-sx-12">
<div id="frames" >
<img id="radar" src="" />
</div>

<div id="allData">
<!-- Temperature -->
<div id="data2">
<h4></h4>
</div>

<!-- Local Condition -->
<div id="data3">
  <h4></h4>
</div>

</div>

</div>

Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 14:11
Thank you @OmranAbazid
CamperBot
@camperbot
Feb 25 2016 14:11
rogue00 sends brownie points to @omranabazid :sparkles: :thumbsup: :sparkles:
:star: 205 | @omranabazid | http://www.freecodecamp.com/omranabazid
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 14:12
some of these challenges have my brain in knots
Matt Leonard
@matty22
Feb 25 2016 14:13
Anyone know how the example project for Wikipedia viewer grabbed the first bit of data from within the wikipedia page?
Omran Abazid
@OmranAbazid
Feb 25 2016 14:14
@ghcarrolljr where is your css
@Rogue00 you need to search online alot and try to understand everything while you are solving.
facing problems will help learn much faster
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 14:16
i have been @OmranAbazid .. some of them just dont seem clear to me
Omran Abazid
@OmranAbazid
Feb 25 2016 14:18
@Rogue00 ask here and people will answer
George Carroll
@ghcarrolljr
Feb 25 2016 14:19

@OmranAbazid }

allData {

background-color:gray;
}

also in js

// css changes
document.body.style.backgroundImage = "url('http://www.georgecarrollengineering.com/weatherImg/rain.jpg')";

document.getElementById("allData").style.backgroundColor = "gray";

nether will work?
Radhika Chaudhary
@radheyIndia
Feb 25 2016 14:21
Question is to return the element which is not common in two arrays
somebody help me with this code
```

```function diff(arr1, arr2) {
var newArr =arr1.concat(arr2);
var array=[],i=0;
function join()
{
var id;
while(i<arr1.length)
{
id=newArr.indexOf(arr1[i]);
while(id!=-1)
{
if(id==-1)
{
array.push(newArr[id]);
}
}
i++;
}
return array;

}
var final=newArr.filter(join());
return final;
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);

Coira Ellison
@Coira
Feb 25 2016 14:22
@ghcarrolljr allData is an id right? so you'll need
#allData { ... }
George Carroll
@ghcarrolljr
Feb 25 2016 14:22
yes
I can change the background on both "data2" and "data3" but not on their parent?
not making sence
Coira Ellison
@Coira
Feb 25 2016 14:26
if the parent has a class or id then you can do .whateverTheParentClassNameIs or #whateverTheParentIDis
kirbyedy
@kirbyedy
Feb 25 2016 14:26
@vichus1995 you did not attached the jquery for start
and this is the log from your console: Uncaught TypeError: Cannot read property 'latitude' of undefined(anonymous function) @ pen.js:7
Lanitta
@DivaWeb
Feb 25 2016 14:27
good morning my fellow campers
Coira Ellison
@Coira
Feb 25 2016 14:28
hi @DivaWeb
Lanitta
@DivaWeb
Feb 25 2016 14:28
@Coira hi coira
kirbyedy
@kirbyedy
Feb 25 2016 14:30
@vichus1995 you have to define lat and lon with variables
Ken Haduch
@khaduch
Feb 25 2016 14:34
@DivaWeb - howdy!
vichus1995
@vichus1995
Feb 25 2016 14:41
thanks @kirbyedy
CamperBot
@camperbot
Feb 25 2016 14:41
vichus1995 sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 542 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
Matas
@bonchanm
Feb 25 2016 14:59
Hey any ideas what to do to make navbar dropdown work in codepen? Something with the settings?
Matas
@bonchanm
Feb 25 2016 15:02
Thanks man, but what I mean the dropdown just doesn't work. Was doing it myself a couple of times, thought made a mistake or smh but now I pasted a template and still nothing. Have no idea whats the deal.
h4r1m4u
@h4r1m4u
Feb 25 2016 15:35
@bonchanm my guess is that you forgot to import the bootstrap.js library. it's required for the dropdown
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 15:41
again im feeling like a retard..
either the directions arent clear or suddenly ive forgotten how to read
this is so frustrating
it gives me an example then lays the challenge out in a completely different fashion and i dont know wth to do....
Anindyo Sen
@AnindyoSen
Feb 25 2016 15:44
Hi
can anyone help me with my quote generator.. I am unable to get the JS working .. plz help
below is a link of my code for reference
http://codepen.io/anindyosen/pen/VerowY?editors=1000
Chris Davis
@chrisdav6
Feb 25 2016 15:45
@AnindyoSen did you include jQuery when creating your pen?
Anindyo Sen
@AnindyoSen
Feb 25 2016 15:45
Yes its there
@chrisdav6 yaah its there
Chris Davis
@chrisdav6
Feb 25 2016 15:47
@AnindyoSen it looks like your syntax is incorrect in your js on line 5
actually, i think its line 4
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 15:48
im not sure why when i need help everyone seems to ignore me but someone posts right after me needing help and someone is right there
crap...nvm
Chris Davis
@chrisdav6
Feb 25 2016 15:50
@AnindyoSen it also looks like you forgot the ) on your document ready closing
Anindyo Sen
@AnindyoSen
Feb 25 2016 15:51
@chrisdav6 yup ... corrected it but still the same .. :P
Chris Davis
@chrisdav6
Feb 25 2016 15:51
I'm not really there yet, so i cant help with the logic, just the syntax
Anindyo Sen
@AnindyoSen
Feb 25 2016 15:52
Hmmm ... actually i am really confused as to how we should use API ... .the FCC tutorial is not sufficient
h4r1m4u
@h4r1m4u
Feb 25 2016 15:59
@Rogue00 as far as i've seen, you haven't asked an actual question. you're just venting your frustration in the channel (not the first time today). i don't see why anybody would be responding to that
@AnindyoSen you still have an issue with your JS syntax (if you're still using the same codepen as you linked above)
Ghost
@ghost~56bd2077e610378809c105cd
Feb 25 2016 16:00
well maybe thats it then
i'm not asking right i guess
yes i am a little frustrated
Anindyo Sen
@AnindyoSen
Feb 25 2016 16:00
@h4r1m4u apart from syntax ..does other things look good ?
h4r1m4u
@h4r1m4u
Feb 25 2016 16:01
@AnindyoSen since you're using mashape, you'll need to get an API from them (http://docs.mashape.com/api-keys). you may then check their documentation example to see how to use the key and call their API: http://docs.mashape.com/javascript#jscript
@AnindyoSen the basics of it look generally ok, but you need to resolve those syntactic errors
Anindyo Sen
@AnindyoSen
Feb 25 2016 16:02
@h4r1m4u ok i think then I need a key to access the API
ok let me read the documentation
Harvey S
@harveysanders
Feb 25 2016 16:10
anyone use webpack with babel-loader?
Armine
@Arminemash
Feb 25 2016 16:15
Hi guys, Does somebody make calculator? Who will tell me what the ans button does? I don't see any activity.
Harvey S
@harveysanders
Feb 25 2016 16:20
@Arminemash i dont really understand your question
darrynwu29
@darrynwu29
Feb 25 2016 16:23
alright.. i'm a bit stuck here on the Pomodora timer. In specific, inside the function startSession(), i'm trying to get function myTimer() to run twice. The first pass is to run the session time. The second pass is to run the break time. For some reason the first time startSession() calls myTimer(), it doesn't run setInterval inside the myTimer() function. I've put a bunch of console logs to debug but can't figure it out. Here's my pen: http://codepen.io/darryn8wu/pen/rxjpQZ?editors=0010
Coira Ellison
@Coira
Feb 25 2016 16:27
@Arminemash ans brings back the answer from the last equation you input. e.g. if you press 1 + 3 =, then press 10 + ans, you will get 10+4
@harveysanders i have, but i'm not sure if i can help you as i'm fairly new to it
h4r1m4u
@h4r1m4u
Feb 25 2016 16:28
@darrynwu29 where in your code do you start the break timer?
Jiimms
@jiimms
Feb 25 2016 16:44
I need help please. My personal portfolio page below: The figcaptions are stretching beyond the image when screen is resized... I just cant figure it out how to get them to fit the image width. Any other feedback/criticism on code is also welcome : http://codepen.io/jiimms/pen/WrBapO
h4r1m4u
@h4r1m4u
Feb 25 2016 16:49
@jiimms the figcaptions expand to the 100% width of the cols. the images don't. you have two options: a) increase the size of the images (i see you're using lorempixel so this would be very easy; reponsive images will automatically downsize to the right width, but they won't upsize), or b) adjust your col classes (for example you could change col-xs-12 to col-xs-6, so that you have 2 projects in a row on xs screens instead of 1).
on another note, your hamburger button (that shows/collapses the menu on small screens) doesn't work. you need to import jquery and bootstrap.js into your pen to make it work
lastly, i don't know if jimms@yahoo.com is your actual email address, but if it is, i wouldn't include it in the page or it'll end up on a ton of junk mailing lists
Oliver Webb
@Ollie15
Feb 25 2016 16:54
hello, how could I make the navigation bar fill the whole page? Thanks! http://codepen.io/Olliewe88/pen/WrBVPw
Jiimms
@jiimms
Feb 25 2016 16:54
@h4r1m4u Thanks a big ton. This is the sixth time I have asked this on different forums and finally got some advise. I will work on it and you have a wonderful day.
I will check on that menu not working. I worked on another text editor and then copied to code pen so maybe I missed something. and thanks for advise on email too
CamperBot
@camperbot
Feb 25 2016 16:54
jiimms sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1483 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
I want the paragraph with id "home" to be below the buttons
h4r1m4u
@h4r1m4u
Feb 25 2016 16:56

@Boomybiscuit45 wrap it in a .row like this:

  <div class="row">
    <ul class="ul">
      <li><a href="#">Home</a>
      <li><a href="#">About Me</a>
      <li><a href="#">Projects</a>
      <li><a href="#">About Me</a>
    </ul>
  </div>

the bootstrap grid structure is: container > row > col

Arpit Saxena
@arpit-saxena
Feb 25 2016 16:56
I am really new to css
h4r1m4u
@h4r1m4u
Feb 25 2016 16:57
@jiimms you're most welcome. this channel tends to pretty active and there's a lot of helpful folks here. hopefully you'll get a faster response for your future questions
Arpit Saxena
@arpit-saxena
Feb 25 2016 16:57
Any advice would be helpful
Omran Abazid
@OmranAbazid
Feb 25 2016 17:00
@arpit-saxena why are you adding position absolute
h4r1m4u
@h4r1m4u
Feb 25 2016 17:00
@arpit-saxena it's the absolute positioning and floats on your elements that throwing things off. remove the absolute position from your elements and see what happens
Arpit Saxena
@arpit-saxena
Feb 25 2016 17:01
@OmranAbazid I want to vertically center the #title... I found this as a method to do that... That's the reason for absolute position
@h4r1m4u
h4r1m4u
@h4r1m4u
Feb 25 2016 17:01
then read through this: http://learn.shayhowe.com/advanced-html-css/detailed-css-positioning/ to understand how to position elements, and this: http://getbootstrap.com/css/#grid to understand how the bootstrap grid system works
darrynwu29
@darrynwu29
Feb 25 2016 17:01
@h4r1m4u i wanted to use myTimer(sessionTimeMins, runBreak) function to run both the session & break time. sessionTimeMins gets passed either the session or break time. runBreak is a boolean that tells it what mode, session or break mode. does that make sense?
Arpit Saxena
@arpit-saxena
Feb 25 2016 17:02
@h4r1m4u I'll just do that
Omran Abazid
@OmranAbazid
Feb 25 2016 17:03
@arpit-saxena bootstrap will center everything inside div with class container
remove absolute positioning from all the elements
and then reorder the elements the way you want
Arpit Saxena
@arpit-saxena
Feb 25 2016 17:04
@OmranAbazid Can u show me a pen with the removed absolute positioning and in which the #title remains the way it is?
I'd really appreciate that
h4r1m4u
@h4r1m4u
Feb 25 2016 17:06
@darrynwu29 yeah, sort of. there's an easier way to do it, but your solution can work too. the reason i was asking is that i didn't see that part anywhere in your code. so is the issue now that your timer doesn't work at all? or what is that you need help with?
Arpit Saxena
@arpit-saxena
Feb 25 2016 17:07
@OmranAbazid I want title o vertically centered and inside a div with height 90%
Panagiotis
@bohemian83
Feb 25 2016 17:17
Hi all, could someone please have a look at my pen and tell me why the hell everything overflows into the next section when I make the screen vertically smaller?
float: none;
oops
darrynwu29
@darrynwu29
Feb 25 2016 17:18
@h4r1m4u, so myTimer() is called twice in the startSession function. But if you look at the console log, the first time it is called, it doesn't make it inside the setInterval to run the clock.. not sure what's happening? Btw, what is your suggestion on making it easier in terms of approach?
h4r1m4u
@h4r1m4u
Feb 25 2016 17:25

@darrynwu29 i'm not sure if i'm missing something but i see it called only once?

function startSession() {
    myTimer(sessionTimeMins);
  }

the easier way to approach it is: store the time currently on the clock in a variable. have one function responsible for setting the interval and the time countdown. have a variable which tracks whether the clock is in a work or break mode. inside the interval, check when the time reaches 0. when it does, assign your work/break session length into the main time variable and flip the value of your work/break mode variable. you don't need to stop or clear the interval - since you adjust the value of the main time variable, it'll simply continue to countdown from the new time. this way you don't need to worry about clearing the work interval and setting a new one for the break, etc. it's easier and cleaner

darrynwu29
@darrynwu29
Feb 25 2016 17:28
ok, got it, cool thanks.. let me see if i can figure this out myself
Pradeep CE
@cepradeep
Feb 25 2016 17:30
http://codepen.io/pradeepce/full/XXwwrE#
I'm building my Local Weather challenge. I have been tinkering with it for over a week and I'm not quiet happy with it. Any suggestions?
Terrell Vest
@MirPresT
Feb 25 2016 17:34
@pradeepce I like the loading, maybe adding more information ? maybe a 3 day forecast ? just some ideas
Armine
@Arminemash
Feb 25 2016 17:34
Guys, Who made the calculator?
Matthew Boland
@mattboland
Feb 25 2016 17:34
i am trying to save the input from the user in a variable searchParam, but I can't seem to log it out. anyone have some insight here? http://codepen.io/MattBoland/pen/WrVJGP?editors=1011
Terrell Vest
@MirPresT
Feb 25 2016 17:35
@Arminemash are you just looking for someone who has built it... I got about 95% there...
Armine
@Arminemash
Feb 25 2016 17:36
@MirPresT tell me plse, what does Ans button do? I don't notice any activity when pressing that button.
Pradeep CE
@cepradeep
Feb 25 2016 17:37
@MirPresT Yes, that should be quiet easy to do. The API returns a 5-day forecast as it is... :)
Jiimms
@jiimms
Feb 25 2016 17:37
@h4r1m4u just added width: 100% to img and my problem is solved :smile: . I have spent two days trying to tame the figcaption before you enlightened me that the problem is with images :+1:
@h4r1m4u :sparkles:
Terrell Vest
@MirPresT
Feb 25 2016 17:38
@mattboland it has to do with the scope of the functions etc... the value is only being set upon the click ... Right now your console.log statement is trying to log the variable when the document loads and is first executed before anyone has even typed or clicked anything.
h4r1m4u
@h4r1m4u
Feb 25 2016 17:38
@jiimms awesome. could you link your codepen again, i want to check something?
Terrell Vest
@MirPresT
Feb 25 2016 17:38
@Arminemash what example are you looking at?
h4r1m4u
@h4r1m4u
Feb 25 2016 17:39
@mattboland yep, as @MirPresT says. your click handler grabs the value from the input correctly, but you need to move the console.log statement inside the handler too:
    searchBtn.click(function(){
       searchParam = document.getElementById("input").text;
       console.log(searchParam);
       searchBar.val("");      
 }); //this grabs user input and places in searchParam
Jiimms
@jiimms
Feb 25 2016 17:40
@h4r1m4u sure, still working on linking jquery http://codepen.io/jiimms/pen/WrBapO
Terrell Vest
@MirPresT
Feb 25 2016 17:40
@Arminemash I don't know who's example that is but it looks like that button doesnt do anything yet
Armine
@Arminemash
Feb 25 2016 17:41
@MirPresT Yes, you are right, baut this example is provided in the task .
@MirPresT
Objective: Build a CodePen.io app that is functionally similar to this: http://codepen.io/FreeCodeCamp/full/zrRzMR.
h4r1m4u
@h4r1m4u
Feb 25 2016 17:42

@jiimms cool. i just wanted to make sure you were using the img-responsive class as well. instead of adding the width: 100% as an inline style for each of the images, add it in your CSS:

.figure img {
  width: 100%;
}

inline CSS should generally be avoided

Terrell Vest
@MirPresT
Feb 25 2016 17:42
@Arminemash interesting. I would suggest looking at a calculator app on your phone if you have a smartphone and trying to add all the functionality that is present or at least all the basic buttons.
Matthew Boland
@mattboland
Feb 25 2016 17:43
@h4r1m4u @MirPresT ok i see that this will log out the value, but then, say i use searchParam at other points in my code, will the value set with that function carry outside? or is it restricted to within that same function that it is defined?
Armine
@Arminemash
Feb 25 2016 17:43
@MirPresT thank you for your advice,but will my project be accepted ?
CamperBot
@camperbot
Feb 25 2016 17:43
arminemash sends brownie points to @mirprest :sparkles: :thumbsup: :sparkles:
:star: 281 | @mirprest | http://www.freecodecamp.com/mirprest
Matthew Boland
@mattboland
Feb 25 2016 17:44
maybe im not understanding the organization of it all and need to sort that out first.
h4r1m4u
@h4r1m4u
Feb 25 2016 17:44
@mattboland it'll be available anywhere withing the scope of the searchWiki function as that's where you declared it
Matthew Boland
@mattboland
Feb 25 2016 17:45
ok, @h4r1m4u that's what i was trying to do. thanks
CamperBot
@camperbot
Feb 25 2016 17:45
mattboland sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1484 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Matthew Boland
@mattboland
Feb 25 2016 17:45
@MirPresT thanks as well
CamperBot
@camperbot
Feb 25 2016 17:45
mattboland sends brownie points to @mirprest :sparkles: :thumbsup: :sparkles:
:star: 282 | @mirprest | http://www.freecodecamp.com/mirprest
h4r1m4u
@h4r1m4u
Feb 25 2016 17:46
the issue was with the console.log statement. when it was outside the click handler it would execute only once - when the page loads - at which point searchParam is just an empty string @mattboland
the reason we put it inside the click handler is so that it executes every time you click the search button
Matthew Boland
@mattboland
Feb 25 2016 17:46
@h4r1m4u oh ok, that clears it up
h4r1m4u
@h4r1m4u
Feb 25 2016 17:47
great
Terrell Vest
@MirPresT
Feb 25 2016 17:47
@mattboland yea you are correct ... what you can do is call another function from your click handler. That way when the user clicks it runs the code you need by calling another function.
Your top level function currently is only executed once when the page loads so keep that in mind when trying to write code in that scope.
Matthew Boland
@mattboland
Feb 25 2016 17:48
@MirPresT good thing to consider, thanks
CamperBot
@camperbot
Feb 25 2016 17:48
:warning: mattboland already gave mirprest points
mattboland sends brownie points to @mirprest :sparkles: :thumbsup: :sparkles:
Jiimms
@jiimms
Feb 25 2016 17:51
@h4r1m4u done. break time now :smile:
h4r1m4u
@h4r1m4u
Feb 25 2016 17:51
@jiimms give yourself a pat on the back :)
Panagiotis
@bohemian83
Feb 25 2016 17:57
Hi all, could someone please have a look at my pen and tell me why the hell everything overflows into the next section when I make the screen vertically smaller? -->bump, anyone??
h4r1m4u
@h4r1m4u
Feb 25 2016 17:59
@bohemian83 when you say 'everything' are you referring to a specific element?
Michael Schomburg
@schombi
Feb 25 2016 18:38
can I position a img-thumbnail in the center of a container without using css and changing the margin? it floats on the left at the moment and I've tried with "col-md-12 col-md-offset-6"
Chris Davis
@chrisdav6
Feb 25 2016 18:50
This message was deleted
@schombi you can change the image to...
img {
display: block;
margin: 0 auto;
}
KacperPorembski
@KacperPorembski
Feb 25 2016 18:56
guys, why my nav doesn't cover the whole page (there is a small margin)?
h4r1m4u
@h4r1m4u
Feb 25 2016 18:58
@KacperPorembski add
body {
  margin: 0;
}
if you're not using web dev tools in your browser, you should look into it. it'll help you troubleshoot all these things
KacperPorembski
@KacperPorembski
Feb 25 2016 18:59
@h4r1m4u thank you :)
CamperBot
@camperbot
Feb 25 2016 18:59
kacperporembski sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1485 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Feb 25 2016 18:59
yw
KacperPorembski
@KacperPorembski
Feb 25 2016 19:02
@h4r1m4u doesn't work
ok i will check web dev tools
h4r1m4u
@h4r1m4u
Feb 25 2016 19:04
@KacperPorembski doesnt' work as in it doesn't fix the gap around the menu? it does for me
Panagiotis
@bohemian83
Feb 25 2016 19:08
@h4r1m4u Well, for example the picture on the second screen and the squares in the third on.
one
Llandy3d
@Llandy3d
Feb 25 2016 19:21
hey can someone check my short pen and help me understand why between the navbar and image there is white space ? http://codepen.io/Llandy3d/pen/obwvQN
Chris Davis
@chrisdav6
Feb 25 2016 19:26
@Llandy3d looks like in chrome developer the nav class has 20px of bottom margin
KacperPorembski
@KacperPorembski
Feb 25 2016 19:26
@h4r1m4u now I have problem with dropdown, again margin, the right one. Do you know why ?
Llandy3d
@Llandy3d
Feb 25 2016 19:27
@chrisdav6 I tried changing padding/margin on everything to 0 but there is still space, nav {
margin-bot: 0px;
} for example
Nicholas
@nick88p
Feb 25 2016 19:27
@Llandy3d I agree with @chrisdav6 , it might be a bootstrap setting of the class
Chris Davis
@chrisdav6
Feb 25 2016 19:28
@Llandy3d
.navbar-static-top {
  margin-bottom: 0;
}
that fixes it, not sure it a good idea to manipulate the bootstrap class though. Or good practice i should say
Llandy3d
@Llandy3d
Feb 25 2016 19:29
@chrisdav6 that worked, do you mind explaining me why this works, and changing "nav" doesn't ?
Chris Davis
@chrisdav6
Feb 25 2016 19:30
i think because .navbar-static-top is more specific.
José Pereira
@jafcpereira
Feb 25 2016 19:30
Hello everyone :)
Chris Davis
@chrisdav6
Feb 25 2016 19:32
It may be farther down the list in bootstrap.css, which would override anything above it.
Llandy3d
@Llandy3d
Feb 25 2016 19:34
mmm I thought since my style.css file comes after the bootstrap one that it should have overriden everything else
Avadhut Mainkar
@Avadhut13
Feb 25 2016 19:34
Can somebody help me with the weather app? I am getting the API response after the page loads even though I placed all things in $(document).ready, What can I do to fix this?
h4r1m4u
@h4r1m4u
Feb 25 2016 19:36

@bohemian83 ah, i see what you mean. it's because of this:

html,
body,
#first,
#second,
#third,
#fourth {
  height: 100%;
}

you're setting all these to height: 100%. html will be set to 100% of viewport, body to 100% height of html and #first, #second, #third and #fourth to 100% height of body. i understand why you're doing (because you want the first section to fill in the entire screen on large screens), but this is what's screwing the layout when the browser is resized vertically. right now i'm not 100% sure if there's pure CSS solution to this, but with a bit of JS you could measure the height of the viewport and if falls below a certain threshold, adjust the height property value accordingly

@KacperPorembski seems like you fixed it? i don't see any issues?
Chris Davis
@chrisdav6
Feb 25 2016 19:38
@Llandy3d that makes sense. Your stylesheet should have overridden it. Not sure what order codepen loads its css. Interesting, If you find out any more info, please let me know.
Panagiotis
@bohemian83
Feb 25 2016 19:40
@h4r1m4u can you point me to a solution? not sure what kind of js code I would have to write.
h4r1m4u
@h4r1m4u
Feb 25 2016 19:41
@bohemian83 jquery has the .height() method which you could use: http://api.jquery.com/height/
Avadhut Mainkar
@Avadhut13
Feb 25 2016 19:46
Can somebody help me with the weather app? I am getting the API response after the page loads even though I placed all things in $(document).ready, What can I do to fix this?
Bruce Young
@mutantspore
Feb 25 2016 19:46
@Avadhut13 we’d need to see it
pen?
h4r1m4u
@h4r1m4u
Feb 25 2016 19:50
@Llandy3d you're right in assuming that your style should override the boostrap.css (and it does).
the bootstrap .navbar class has a 20px bottom margin. when you defined 0px bottom margin on nav, it wouldn't override it, because class selector has a higher level of specificity than a type selector as @chrisdav6 pointed out. this is regardless of whether your CSS file is loaded after the bootstrap one or not.
however, if you define the 0px bottom margin on .navbar-static-top, it's also a class - so both the .navbar and .navbar-static-top style definitions have the same level of specificity and since your CSS is properly loaded after the bootstrap CSS, your definition successfully overrides the bootstrap one. i hope this makes sense and sheds some light on it
Avadhut Mainkar
@Avadhut13
Feb 25 2016 19:50
Panagiotis
@bohemian83
Feb 25 2016 19:50
@h4r1m4u is there no other way to prevent the overflow? by making for example everything inside a section resize in height if it reaches the end of the section? is there a way for the screens to stay so without using the 100% height on the hmtl and body? if I remove it the become really thin or they disappear.
h4r1m4u
@h4r1m4u
Feb 25 2016 19:54
@bohemian83 if you want the sections to fill 100% height of the viewport on large screens, i can't currently think of a way to do it (though it may be possible). if you don't necessarily need to insist on the section to fill 100% of the viewport, you could use a fixed height (e.g in px), or min-height, on your sections instead of the % based height
Andrea Santana
@andreaweb
Feb 25 2016 19:54
@Avadhut13 taking a look at it
Chris Davis
@chrisdav6
Feb 25 2016 19:54
@h4r1m4u ahhhh, thank you for the class and type specificity explanation. Really had me stumped
CamperBot
@camperbot
Feb 25 2016 19:54
chrisdav6 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1486 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Feb 25 2016 19:55
no worries!
Andrea Santana
@andreaweb
Feb 25 2016 20:02
@Avadhut13 are you therE?
Avadhut Mainkar
@Avadhut13
Feb 25 2016 20:03
@andreaweb yeah
Andrea Santana
@andreaweb
Feb 25 2016 20:03
@Avadhut13 you're confused because the info wasn't loading, right?
Avadhut Mainkar
@Avadhut13
Feb 25 2016 20:03
@andreaweb yes
Andrea Santana
@andreaweb
Feb 25 2016 20:03
@Avadhut13 my first advice is, don't let yourself be overwhelmed by the code, test it in small bits first
@Avadhut13 maybe you've done it already, but keep it in mind :D
the info isn't loading yet, but now I know the url is working
(I checked it by Inspecting element and then checking console in my browser - Google Chrome)
so you can do the same
if you're getting information from an external source, logically, the external source link must be correct, otherwise you really won't get anything, so always check that first
(I'm gonna further modify that code now)
did you understand what I did/how/why?
Avadhut Mainkar
@Avadhut13
Feb 25 2016 20:08
@andreaweb i didn't get the modified code
Andrea Santana
@andreaweb
Feb 25 2016 20:08
sec, I'll undo my recent changes
alright, back
the current code in my pen practically just tests if the url is working
well, it displays the url in your console so you can test if it's working
do you use Google Chrome?
to check its console I inspect element and then click the tab "Console"
I imagine in other browsers it's not too different
you should see an url there, copy it and try it out in a new tab
Andrea Santana
@andreaweb
Feb 25 2016 20:13
so I didn't solve your problem yet, but now I'm sure the url works and I can move on to the next step
Avadhut Mainkar
@Avadhut13
Feb 25 2016 20:14
@andreaweb ok
Andrea Santana
@andreaweb
Feb 25 2016 20:14
you can and should test it yourself, I think the url might not be working the way your code currently is (I'm no expert in JS though, in fact I'm doing the same app now, but I got at least that part :) )
I'll leave that code unchanged in case you need it and I'll work in a new one
@Avadhut13 sorry, I'm at work and I have stuff to do now so I can't help you further :(
if it helps you can check my current app http://codepen.io/acosmos/pen/wGwroV
you're going well, I think there's just some orders issues there, and test one thing at a time :)
Avadhut Mainkar
@Avadhut13
Feb 25 2016 20:18
@andreaweb check this out.I made a little change in code so that if you click on "know your weather" it will display the info. So url is working and api response is there
Andrea Santana
@andreaweb
Feb 25 2016 20:19
@Avadhut13 show me!
Andrea Santana
@andreaweb
Feb 25 2016 20:20
nice, grats!
Jonathan Mitchell
@Vanhealen
Feb 25 2016 20:21
The convert JSON Data to HTML challenge is really vague and does not explain much about what I am supposed to be doing, any help?
It gave me a huge block of code I can’t read
Andrea Santana
@andreaweb
Feb 25 2016 20:21
yeah I agree @Vanhealen
Jonathan Mitchell
@Vanhealen
Feb 25 2016 20:21
I literally have no idea what they want
Is there a better resource for learning this?
Chris Davis
@chrisdav6
Feb 25 2016 20:24
This message was deleted
This message was deleted
Nicholas
@nick88p
Feb 25 2016 20:52
@Vanhealen I felt the same way. I would recommend you go through it twice and then continue with the weather challenge.
That will practice JSON and all those functions in detail.
the api needs to be called from within the geolocate as it’s an asychronous process
Jeremy
@JeremyAntonoff
Feb 25 2016 21:07
function chunk(arr, size) {
  // Break it up.
  var begArray = arr.slice(0, size);
  var final = [];
  var slice;

  for (i=0;i<arr.length;i+size) {
    slice = arr[i].slice(size);
  }

  return slice;
}


chunk([0, 1, 2, 3, 4, 5], 2);
why do i get arr[i].slice is not a function
bitgrower
@bitgrower
Feb 25 2016 21:07
@JToddFL -- because arr is not seen as an array
usually, anyway ...
it can also mean you fell off the end of the array, as well, I believe ...
Jeremy
@JeremyAntonoff
Feb 25 2016 21:09
so i can do
var newArray = [arr]
then set that statement to slice = newArray[i].slice(size)
bitgrower
@bitgrower
Feb 25 2016 21:13

slice in the way you are using it (I believe) requires 2 arguments ... the first one is the START ... the second one how far to slice up to (that is, the first index array position to NOT be included ...

check the Mozilla Developer Network on array.prototype.slice()

not sure exactly about the 2nd argument, I get the 2nd arguments on slice & splice mixed up
but ... it's essentially the same idea, just addressed differently ...
Jeremy
@JeremyAntonoff
Feb 25 2016 21:15
```js
  for (i=0;i<newArray.length;i = i + size) {
    slice = newArray.slice(newArray[i],size);
    var final = slice.push(final);
  }

  return final;
thats what i acme up with but still a no go
bitgrower
@bitgrower
Feb 25 2016 21:15
you use console.log, @JToddFL ?
Jeremy
@JeremyAntonoff
Feb 25 2016 21:15
yes
bitgrower
@bitgrower
Feb 25 2016 21:16
use that, or run your code here: http://pythontutor.com/javascript.html
you can see, step by step, what your code is doing
it looks to me like you are probably running off the end of your array
Jeremy
@JeremyAntonoff
Feb 25 2016 21:17
i am so confused
i dunno even what this means
bitgrower
@bitgrower
Feb 25 2016 21:18
it means index >= length
i ...
Jeremy
@JeremyAntonoff
Feb 25 2016 21:18
im just gonna move past this one for now
and try a new one
bitgrower
@bitgrower
Feb 25 2016 21:18
so, if your array is 4 elements long, you would use i=4 ... which is invvalid ...
@JToddFL -- go look at it on pythontutor -- I'm sure you'll be able to easily see what's going on and what needs to be fixed ...
Kevin De Baerdemaeker
@kefkef5
Feb 25 2016 21:20
People familiar with the HTML5 boilerplate?
bitgrower
@bitgrower
Feb 25 2016 21:21
nope don't know what you are referring to ... @kefkef5
oops
bitgrower
@bitgrower
Feb 25 2016 21:24
LOL ... don't think I need to add another technology onto my plate atm ... got enough on it as it is ...
Casey Heath
@ExhibitArts
Feb 25 2016 21:24
Anyone know why padding isn't working on my content-container class? - http://explorecode.byethost8.com/
Mark Lawrence
@ninja-ml
Feb 25 2016 21:26
i'm just starting the twitch tv project and want to make sure I understand it correctly... we should use the array they give us to see if those twitch users are currently streaming?
Amir Ghafouri
@amirghafouri
Feb 25 2016 21:29
Do I have the right approach to changing the background image based on the weather api? It's not working for some reason (always shows the Snowy background even though weather in my area is Clouds) http://codepen.io/amirghafouri/pen/WweNEX?editors=0010
Casey Heath
@ExhibitArts
Feb 25 2016 21:33
Anyone know why padding isn't working on my content-container class? - http://explorecode.byethost8.com/
^^ Can someone please help?
Marek Slabicki
@thaniri
Feb 25 2016 21:34
what's not working?
if i mess around with it in developer tools i can change the padding just fine
Omran Abazid
@OmranAbazid
Feb 25 2016 21:35
@amirghafouri your problem is in the if statement
if(==) instead of just one =
Victoria Mielke
@CraneWing
Feb 25 2016 21:35
I am doing the recipe box project. I can add a recipe through a form, and I can retrieve my list of recipes from local storage. I can add the new recipe to the list of recipes, but when I try to save the new list back, it won't update local storage.
My code is in a submit handler, like so:
Omran Abazid
@OmranAbazid
Feb 25 2016 21:37
you are giviing you content container 0 padding
.content-container { padding: px 0px 0px 0px; }
Victoria Mielke
@CraneWing
Feb 25 2016 21:38
 handleSubmit: function(event) {
    event.preventDefault();
    var form = event.target;
    var title = form.querySelector('[name="title"]').value;
    var image = form.querySelector('[name="image"]').value;
    var ingredients = form.querySelector('[name="ingredients"]').value;
    var steps = form.querySelector('[name="steps"]').value;

    var recipeArr = JSON.parse(localStorage.getItem('recipes'));
    console.log(recipeArr);
    recipeArr.push({ title: title, image: image, ingredients: ingredients, steps: steps });
    console.log(recipeArr);
    console.log(localStorage.setItem('recipes', JSON.stringify(recipeArr)));

  },
`
Amir Ghafouri
@amirghafouri
Feb 25 2016 21:38
@OmranAbazid doh lol... I keep forgetting basic things as I learn more advanced things haha, thanks
CamperBot
@camperbot
Feb 25 2016 21:38
amirghafouri sends brownie points to @omranabazid :sparkles: :thumbsup: :sparkles:
:star: 207 | @omranabazid | http://www.freecodecamp.com/omranabazid
Gabriel
@Zera99
Feb 25 2016 21:39
http://codepen.io/Zera99/pen/mVNrga?editors=1010 Why is the switch statement not working? (To change the backgrounds) =(
Victoria Mielke
@CraneWing
Feb 25 2016 21:40
Can someone help me with my recipe box problem?
Caleb Martin
@caleb272
Feb 25 2016 21:41
where in the twitch API do you check if the player is streaming?
ALINATSUI
@ALINATSUI
Feb 25 2016 21:44
hi...not sure if this is the right room, but I'm up to the "Build a Tribute Page.." challenge...are there any restrictions on who we
Casey Heath
@ExhibitArts
Feb 25 2016 21:44
@OmranAbazid Yeah I know that but I don't want to give it any padding, in fact I'm trying to take the padding away but it doesn't work. Any idea why?
ALINATSUI
@ALINATSUI
Feb 25 2016 21:44
we're dedicating the page to?
Victoria Mielke
@CraneWing
Feb 25 2016 21:45
Is this the wrong place for the React projects?
Caleb Martin
@caleb272
Feb 25 2016 21:45
probably
Victoria Mielke
@CraneWing
Feb 25 2016 21:46
Where can I get help on ReactJS projects:
Jess
@JesstheBP
Feb 25 2016 21:46
Hey, can I get some help with the random quote generator? I know there's something simple i'm missing, i'm just not sure what it is; http://codepen.io/jestershark/pen/eZOKay ..
Casey Heath
@ExhibitArts
Feb 25 2016 21:48
@thaniri I'm trying to take away the padding but for some reason it doesn't work.
Jason
@carpediem1213
Feb 25 2016 21:48
Hi, I have a question regarding the random quote generator. I've done all of the basic algorithms, basic front end projects and the AJAX/JSON stuff. When I look at the example's code in the editor, none of it makes any sense to me. Where should I go to prepare me for the intermediate FE projects?
Casey Heath
@ExhibitArts
Feb 25 2016 21:51
@thaniri @OmranAbazid Do you see how there is yellow around the content container? I'm trying to remove that if possible.
Bruce Young
@mutantspore
Feb 25 2016 21:51
@CraneWing Datavisualisation help room
rooms
CamperBot
@camperbot
Feb 25 2016 21:51

rooms

See all the FreeCodeCamp rooms at gitter.im/FreeCodeCamp/rooms
Or check this wiki article for a shortlist
Casey Heath
@ExhibitArts
Feb 25 2016 21:51
@thaniri @OmranAbazid Do you see how there is yellow around the content container? I'm trying to remove that if possible.
Jason
@carpediem1213
Feb 25 2016 21:56
Quick question: which resources online besides the 7 AJAX challenges on FCC will prepare me to build the random quote generator, weather app, etc?
Omran Abazid
@OmranAbazid
Feb 25 2016 22:01
@ExhibitArts man there is not yellow
@OmranAbazid there is nothing yellow in the page
Bruce Young
@mutantspore
Feb 25 2016 22:07
@Zera99 http://codepen.io/MutantSpore/pen/aNojdR
the imag ethat it wanted to put up for me was not actually an image but a page… so it failed. (800) I replaced it with one of your others to check.
Gabriel
@Zera99
Feb 25 2016 22:08
Oh.. Maybe that was it.. might've copied the wrong link to the image
Bruce Young
@mutantspore
Feb 25 2016 22:09
@Zera99 I also made a class called pic rather than talk to teh actual body and added that class to body + som epicture display stuff. I also removed some extra quotes in the urls
not all of that may be needed to get it to work though
Gabriel
@Zera99
Feb 25 2016 22:10
Yeah, I copied the wrong link
Now it opens, but I need to fix the size
Bruce Young
@mutantspore
Feb 25 2016 22:11
well look at my pen… i have a class in teh css called pic . that will show youhow to size it
for full screen anyway
@JesstheBP don’t have time to fully look but the first problem is that you don’t have jQuery loaded
Gabriel
@Zera99
Feb 25 2016 22:14
thanks @mutantspore
CamperBot
@camperbot
Feb 25 2016 22:14
zera99 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1172 | @mutantspore | http://www.freecodecamp.com/mutantspore
Jess
@JesstheBP
Feb 25 2016 22:17
Thanks @mutantspore that isn't quite the main problem but it was definitely A problem...
CamperBot
@camperbot
Feb 25 2016 22:17
jessthebp sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1173 | @mutantspore | http://www.freecodecamp.com/mutantspore
robynsmith
@robynsmith
Feb 25 2016 22:28
I’m trying to get a very basic page going from the challenges:
"Change Text with Click Events"
When I click the button, nothing happens. What am I doing wrong?
(I’m trying to get it working with a .html file on my machine before working on the first JS-required project)
Jess
@JesstheBP
Feb 25 2016 22:31
thanks again @mutantspore ! that makes a lot more sense
CamperBot
@camperbot
Feb 25 2016 22:31
jessthebp sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: jessthebp already gave mutantspore points
bitgrower
@bitgrower
Feb 25 2016 22:35

hello ... can someone help me with this ?

how would I reproduce this challenge http://www.freecodecamp.com/challenges/get-json-with-the-jquery-getjson-method on codepen.io ? I'm assuming I need the full url for the referenced json/cats.json ... but I don't know what that would be ...

robynsmith
@robynsmith
Feb 25 2016 22:40
@bitgrower I actually am on the same step. The info from there could help me too!
Casey Heath
@ExhibitArts
Feb 25 2016 22:46
@OmranAbazid No when you hover your mouse pointer over the content-container class there is yellow around the container. http://explorecode.byethost8.com/
bitgrower
@bitgrower
Feb 25 2016 22:46
LOL ... well, the challenge, I solved ... I just want to get it to run on codepen.io ...
I've tried using ... http://www.freecodecamp.com/json/cats.json ... but ... nothing ...
robynsmith
@robynsmith
Feb 25 2016 22:47
@bitgrower Yeah, I solved the challenge too
@bitgrower I’m actually trying to get it to work on codpen / a .html file on my own machine
bitgrower
@bitgrower
Feb 25 2016 22:48
whatever issue I am running into by doing this relatively simple challenge on codepen instead of FCC, I'm sure will be problems I'll face with other api challenges ...
robynsmith
@robynsmith
Feb 25 2016 22:48
nod
Exactly
bitgrower
@bitgrower
Feb 25 2016 22:58
a friend of mine tried just putting in an alert & it didn't work ... sigh ...
robynsmith
@robynsmith
Feb 25 2016 23:01
@bitgrower I asked in the main FCC chatroom
maiamigliaro
@maiamigliaro
Feb 25 2016 23:02
Hi! How I post a quotation(in the random quote machine) in twitter? I mean posting a tweet with a javascript variable?Help?
Andrew Perrin
@Pezz18
Feb 25 2016 23:04
@bitgrower i think i had this issue the otherday
@bitgrower i think you need to go into your pen settings and enable jQuery under the javascript tab
Jeremy
@jer244
Feb 25 2016 23:17
Does anyone have any suggestions for learning about the classes within bootstrap? I just started FCC and am working on the tribute page... I feel like the first few sets of lessons were a good intro to HTML but didn't teach much about the various tools within bootstrap.. Any help greatly appreciated..
robynsmith
@robynsmith
Feb 25 2016 23:21
@bitgrower So it turns out you can’t get it to work on codeine:
*code pen:
XMLHttpRequest cannot load http://www.freecodecamp.com/json/cats.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access.
Satchmo37
@Satchmo37
Feb 25 2016 23:28
@robynsmith try changing your format to jsonp
The error you're getting is in reference to a cross-domain call, jsonp should get you through...
Need some help with wikipedia viewer. I'm trying to get the thumbnails with each article, I've added the prop: pageimages but am not returning the source url for each image. I get an object: `continue: '-\pageimages'...
My ajax call looks like this...
 $.ajax({
            url: searchUrl,
            dataType: 'jsonp',
            data: {
                'action': 'query',
                'srsearch': toSearch,
                'prop': 'pageimages',
                'list': 'search',
                'format': 'json'
            }, //End data
Jeremy
@jer244
Feb 25 2016 23:31
@Satchmo37 Thank you. I will check this out.
CamperBot
@camperbot
Feb 25 2016 23:31
jer244 sends brownie points to @satchmo37 :sparkles: :thumbsup: :sparkles:
:star: 296 | @satchmo37 | http://www.freecodecamp.com/satchmo37
Satchmo37
@Satchmo37
Feb 25 2016 23:32
@jer244 Great Bootstrap stuff there with demo's and visualization!
ch33s3cr4ck3r
@ch33s3cr4ck3r
Feb 25 2016 23:58
hey guys need some help, im building the portfolio page and am having issues with getting the background image to stay the full width of the page. i get the parallax effect, but its only showing a portion of the background picture. i tried putting all this in the header, and making a css class but im not getting any luck
was really hoping to get some help