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
JD Tadlock
@jdtdesigns
@clnquacky $("#.clearsall") is your problem
you need to either select an id or select a class
Austin Miles
@Nolo900
@jdtdesigns I'm currently in Spain and can only use the browser geoLocation feature if in https... So I guess Im out of luck?
Charlotte N.
@clnquacky
okay.. Thank you.. Let me go play with that @jdtdesigns
CamperBot
@camperbot
clnquacky sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 537 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
JD Tadlock
@jdtdesigns
@Nolo900 Doesn't matter where you are. You can use http://ip-api.com/json to return location based on ip address. For other browsers you use navigator.
Charlotte N.
@clnquacky
@jdtdesigns Thank you. I knew it was something simple and small.. That worked
CamperBot
@camperbot
clnquacky sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: clnquacky already gave jdtdesigns points
JD Tadlock
@jdtdesigns
if ( window.chrome ) {
  $.getJSON('http://ip-api.com/json', function(json) {
    // save the data
  });
} else {
  if ( navigator.geolocation ) {
  navigator.geolocation.getCurrentPosition(function(data) {
    // save the data
  });
}
@Nolo900
Austin Miles
@Nolo900
@jdtdesigns myBrowser wont return geoLocation data from the brower without https, are you saying to use the ip-api to get my geolocation data for the weatherapi call?
JD Tadlock
@jdtdesigns
@Nolo900 Don't run codepen in https. It won't work with OpenWeather
Austin Miles
@Nolo900
I get this error "ERROR(1): Only secure origins are allowed (see: https://goo.gl/Y0ZkNV)."
JD Tadlock
@jdtdesigns
@Nolo900 post your codepen
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.