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
Austin Miles
@Nolo900
JD Tadlock
@jdtdesigns
@Nolo900 You need to do what I said above with the if/else.
Austin Miles
@Nolo900
@jdtdesigns Ok, I'll try that, thanks.
CamperBot
@camperbot
nolo900 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: nolo900 already gave jdtdesigns points
JD Tadlock
@jdtdesigns
@Nolo900 Also, you're not processing the data right. You need to get the location, then fire a function to get the weather. The json request to OpenWeather needs the location.
Austin Miles
@Nolo900
@jdtdesigns I thought that's what I was doing. I wanted to get the coordinates, put them into variables, then pass those into the weather request URL, I just ran into issues with these errors. I'm also having a hard time getting used to the JS syntax, all these nested functions and brackets/semicolons are killing me.
JD Tadlock
@jdtdesigns
@Nolo900 The joys of learning new languages. ;)
Dan Logajan
@hiltydiggs
Still working on this problem: http://codepen.io/dlogajan/pen/vKyOmG if anyone has insight. Thanks.
JD Tadlock
@jdtdesigns
@hiltydiggs Are you trying to setup a click event to add the token when the user clicks?
Dan Logajan
@hiltydiggs
Eventually. Right now I'm just trying to append the image to a single div, but it only inserts as a string.
JD Tadlock
@jdtdesigns
Also, you're selecting the first square wrong. Since it is a jquery object collection, you need to use squares.first().append(xMarker); or squares.eq(0).append(xMarker);
Dan Logajan
@hiltydiggs
@jdtdesigns ah ha! Thank you. That's what I was looking for.
CamperBot
@camperbot
hiltydiggs sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 538 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
Austin Miles
@Nolo900
@jdtdesigns What do you think of this approach? Am I not accessing the JSON data correctly? http://codepen.io/abm/pen/vKYWNy
Dinesh
@Dinesh9387
Guys, how can i get the navigation bar to overlap with the background image???
Dan Logajan
@hiltydiggs
@Dinesh9387 have a link?
Dan Logajan
@hiltydiggs
@Dinesh9387 apply your background image in css instead of an inline img html element
Dinesh
@Dinesh9387
i cant think of anything further... all i ended up doing was to get the nav bar buttons on top of the background image
Dinesh
@Dinesh9387
@hiltydiggs cud u elaborate pls??
anyone can help me, please ?
thanks
JD Tadlock
@jdtdesigns
$(document).ready(function() {
  var posLog;
  var posLat;

  var init = function() {
    getLocation();
  };

  var getLocation = function() {
    if (window.chrome) {
      $.getJSON('http://ip-api.com/json', function(json) {
        posLog = json.lon;
        posLat = json.lat;

        getWeather();
      })
    } else {
      if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(function(data) {
          posLog = data.coords.longitude;
          posLat = data.coords.latitude;

          getWeather();
        });
      }
    }
  };

  var getWeather = function() {
    $.getJSON(
      "http://api.openweathermap.org/data/2.5/weather?lat=" + posLat + "&lon=" + posLog + "&appid=433719a5f94053c00f278be7e806c268",
      function(data) {
        // Success! Do stuff with data.
        $('#userLatitude').text(posLat);
        $('#userLongitude').text(posLog);
      });
  };

  init();
});
@Nolo900
functions are your friend
Dan Logajan
@hiltydiggs
@Dinesh9387
body {
  background: url("http://wallpaper.pickywallpapers.com/1920x1080/wood-board.jpg");
}
Normally put it on your wrapping div. And remove the <img> from your html.
Hristijan Gjorgjievski
@hristijankiko
Anyone knows why my random quote generator generates only one quote then just shows the same one every time i press the button? http://codepen.io/hristijankiko/pen/VjKmwL
JD Tadlock
@jdtdesigns
@hristijankiko The random quote url doesn't work on quotesondesign. You can return 30 quotes and save them to an array, then use that to get random quotes.
Hristijan Gjorgjievski
@hristijankiko
@jdtdesigns but is it not doable with an API?
JD Tadlock
@jdtdesigns
@hristijankiko You get the 30 quotes from the api, then loop through the returned json and push the quotes to an array. Then use that array to get random quotes.
There are plenty of apis that have working random quote urls though.
Hristijan Gjorgjievski
@hristijankiko
ahh okay
Syahri Ramadhan
@SPMechanic
Erm, got a bit stuck on project "Build a Tribute"
my codepen here
i just confused, how to centered <LI> element..what Bootstrap class that i must utilize? I hack my way to center the DIV element using css (got it from stack-overflow), but it not working for unordered list. :(
Syahri Ramadhan
@SPMechanic
but i did not found any class suitable for my needs, i am just clueless...what did i miss?
andreas2249
@andreas2249
Good morning, Campers. Anyone know how to center an image inside a <figure> element? When my 'Portfolio' is stretched to full width, the images stay pushed to the left -- leaving a large space to the right. I think centering the image is a reasonable fix. Here's my CodePen (click 'Portfolio' link to see it): https://codepen.io/andreas2249/pen/ezdbEe
Daniel Cartín
@Danielcv93
hi, how can I make a button carry out an action of Java Script?**
Sorin Ruse
@sorinr
@jdtdesigns thank's for your yesterday message " @sorinr It's still not clearing each timeout. Each time you type, it starts a new timeout that gets results. This causes a stack of timeouts that fire one after another. You need to clear the timeout each time the user starts typing before creating the timeout to get results. ;)" regarding my wikipedia app. You suggest that on keyup event to "clear" the stack of all previous calls?
CamperBot
@camperbot
sorinr sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 539 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
andreas2249
@andreas2249
@Danielcv93, here's the basic format: <button onclick="myFunction()">Click me</button>