Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
CamperBot
@camperbot
pae4557 sends brownie points to @mirabalj and @vinaypuppal :sparkles: :thumbsup: :sparkles:
:cookie: 417 | @vinaypuppal |http://www.freecodecamp.com/vinaypuppal
:cookie: 355 | @mirabalj |http://www.freecodecamp.com/mirabalj
Sorin Ruse
@sorinr
@pae4557 which img?
Jinme Mirabal
@mirabalj
I'm working with React projects but I have a problem in a Leaderboard project, in the line 46 don't update "order" state. I don't know what happend, any idea? http://codepen.io/mirabalj/pen/AXxqpx
Sorin Ruse
@sorinr
@mirabalj can you console.log(pos) and see what u get?
Islam Ibakaev
@dagman
hey guys does it looks good? http://dagman.github.io/
Jinme Mirabal
@mirabalj
@sorinr yes, the same values. It's crazy.
Line 43 and 48, before and after
Sorin Ruse
@sorinr
@mirabalj move it where do have the logic that can change it to see what happens
Daniel Pitulia
@danielpitulia
Do you guys remove sass files when deploying to live sites? They don't actually do anything right, after they are compiled?
Jinme Mirabal
@mirabalj
@danielpitulia I'ts necessary sass files? I don't think so.
compile sass files to css and deployment these. Seems like a good idea.
@sorinr I change a bit getData function, this works now. But the mistery continues :smile:
jcob95
@jcob95
Hi, I'm having trouble with the openweather API. I get the users longitude and latitiude and get a url that works fine (I see the JSON) but when I try and store data into variables it returns undefined.
var url = "api.openweathermap.org/data/2.5/weather?lat=" + latitude+"&lon="+longitude+"&appid=5811a808db020c08d96e634ccf09bb52";
  $.getJSON(url,function(data){
var location = data.name;
  });

  console.log(location);
Jinme Mirabal
@mirabalj
@jcob95 your declaration is inner function(data), declare location outside, with url.
jcob95
@jcob95
it is declared outside
Oh sory, wrong var
Jinme Mirabal
@mirabalj
@jcob95 not really
:smile:
jcob95
@jcob95
var url = "api.openweathermap.org/data/2.5/weather?lat=" + latitude+"&lon="+longitude+"&appid=5811a808db020c08d96e634ccf09bb52";
  $.getJSON(url,function(data){
 conditions = data.name;
  });

  console.log(conditions);
I declared conditions at the beginning
still returns undefined
Jinme Mirabal
@mirabalj
@jcob95 you should validate the JSON returned. What happend if received error?
´´´
{
cod: "404",
message: "Error: Not found city"
}
´´´
jcob95
@jcob95
I agree I need to do this, but for now, provided there is no error, the variables should not return undefined. Unless there is an error I haven't seen
Jinme Mirabal
@mirabalj
@jcob95 what JSON is returned? Log your data var.
jcob95
@jcob95
reeturned undefined
Jinme Mirabal
@mirabalj
Ah, don't forget "http://" in url. @jcob95
It's not magic :smile:
jcob95
@jcob95
I added it, but unfortunately it still returns undefined
wirthual
@wirthual
@jcob95 What happens if you past the url in your browser? Do you get the data you want?
jcob95
@jcob95
Yes
it returns this (removed my location purposely)
weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"base":"cmc stations","main":{"temp":296.42,"pressure":1023,"humidity":73,"temp_min":295.15,"temp_max":297.59},"wind":{"speed":4.6,"deg":250},"clouds":{"all":0},"dt":1468696915,"sys":{"type":1,"id":5078,"message":0.01,"country":"GB","sunrise":1468641828,"sunset":1468699897}
is my syntax for accessing the array correct?
Jinme Mirabal
@mirabalj
@jcob95 show your code in a tool like jsfiddle or codepen, please.
Daniel González Reina
@dgrcode
What do you need @jcob95 ?
Jinme Mirabal
@mirabalj
@jcob95 property "name" don't exists in JSON returned
Ken Haduch
@khaduch
@jcob95 - you need to put an "http://" in your URL for the weather site, at least that's one thing...
Tyler Moeller
@TylerMoeller
@jcob95 A couple of issues.
navigator.geolocation requires HTTPS, but your weather API only works over HTTP. Try using http://ip-api.com/json for location or choose a weather api that supports HTTPS (like forecast.io or weather underground)
Your location variable is scoped to your anonymous getJSON function. To use it elsewhere, pass it to another function like:
  $.getJSON(url,function(data){
    var location = data.name;
    logToConsole(location)
  });

  function logToConsole(location) {
    console.log(location)
  }
Ken Haduch
@khaduch
@jcob95 - I was going to add that I ran it on Firefox, where the geolocation still works in "http://". Just adding the "http://" to your openweather URL looks like it fetches the data. @TylerMoeller 's explanation of the problem with HTTP vs. HTTPS and geolocation and openweather is correct.
Tyler Moeller
@TylerMoeller
@neecholaus remove the li settings in your CSS, close your <a> tags, and add class="navbar nav" to your ul:
      <ul class="navbar nav">
        <li><a href="#">HOME</a></li>
        <li><a href="#">ABOUT</a></li>
        <li><a href="#">PORTFOLIO</a></li>
      </ul>
Bryan
@jbhand75-coder
Geolocation should work fine for Firefox and Safai with HTTP, it is Chrome that requires the HTTPS. That may be the problem you are running into.
Jakob Essig
@Jecousa
I need some help with a two-dimensional array. What I am trying to do is have a random music video displayed with the lyrics when the user clicks the button. I can get it to work when there's only one item in the array, but can't figure out how to display both.
Gabriela Lobinska
@gabriela3001
Hi, I am nearly done with the random quote machine, however I have an issue with the Twitter button
The output in the twitter page keeps the tags and also does not return apostrophes and other special characters correctly