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
dyon3334
@dyon3334
array.entries() what does it ?
Umar Khan
@umar-khan
test
iso
@iso1048
@rafaelmonroy one way could be to declare the variable outside the ajax call
Ross Scarborough
@SourceHorse
having an issue with codepen. When I click a link, it won't always open in codepen, but if it middle mouse click, it will open in a new tab correctly
Trommelochse
@Trommelochse
@SourceHorse have you tried the some code on your local machine? Codepen is awesome, but also has its limits
Ross Scarborough
@SourceHorse
not yet, I could try exporting
just1witness
@just1witness
Is it because of the target blank thing? @SourceHorse
Ross Scarborough
@SourceHorse
tried both ways with no success
piteto
@piteto
@dyon3334 That's brand new JS, won't work in most browsers. It lists key/value pairs of an object
just1witness
@just1witness
@piteto It's pretty...
piteto
@piteto
seems useful once browsers support it...
just1witness
@just1witness
@piteto agreed
piteto
@piteto
@SourceHorse I found this article describing one possible issue with codepen links. You may want to add target="_blank" to your URLs https://stackoverflow.com/questions/31756380/left-clicking-links-doesnt-work-in-codepen-but-open-in-new-tab-does
For security, though, be sure to also add rel="noopener noreferrer"
Ross Scarborough
@SourceHorse
@Trommelochse @piteto @just1witness thanks for your help
CamperBot
@camperbot
sourcehorse sends brownie points to @trommelochse and @piteto and @just1witness :sparkles: :thumbsup: :sparkles:
:cookie: 323 | @trommelochse |http://www.freecodecamp.com/trommelochse
:cookie: 39 | @piteto |http://www.freecodecamp.com/piteto
:cookie: 314 | @just1witness |http://www.freecodecamp.com/just1witness
Christopher
@chris-loyd
Man, CSS Grid almost feels like cheating
Trommelochse
@Trommelochse
@piteto he isn't even using React
rafaelmonroy
@rafaelmonroy
Gitter phone app is not as practical as I thought it would be, being an app for developers or people learning how to write code
Trommelochse
@Trommelochse
@rafaelmonroy also heard shit about the gitter mobile app, and it obviously should be better - but then again: who is gonna write code on his/her phone? :/
let's step back for a moment and embrace what we got free, nowadays
Think about the times when Altavista was considered to be a search engine
and so on...
Tom
@moT01
dial-up with netscape on windows 95
rafaelmonroy
@rafaelmonroy
Lol true, guess beggers can't be choosers but the fact still stands
rafaelmonroy
@rafaelmonroy
@gothamknight when I tried setting the variable out the Ajax it doesn't register
iso
@iso1048
@rafaelmonroy can i see your code?
Ghost
@ghost~55a04b725e0d51bd787af54c
Hi guys
I need some help fixing some jQuery
When I change the speed of the rotation, it doesn't occur immediately, but after 30seconds (1 full normal rotation).
How can I change this?
Here is the pen: https://codepen.io/Refath/pen/zdeWxa?editors=1010
Any help is appreciated!
Tom
@moT01
what's the problem
changing the css, .parent - animation not work?
rafaelmonroy
@rafaelmonroy
@gothamknight
$(document).ready(function (){

  function getWeather(position) {

      var lat = position.coords.latitude;
      var long = position.coords.longitude;

      $.ajax({
        type:'GET',
        url:'https://maps.googleapis.com/maps/api/geocode/json?latlng='+lat+','+long+'&key=AIzaSyCwOc9_sxzQyW-U96Eg_2kiLsfwRxhkBf0',
        success: function(location){
          var city = location.results[0].address_components[2].long_name
          $('#city').text(city)
        }
      });
        var celcius = Math.floor(weatherInfo.main.temp)
        var farenheit = Math.floor((1.8 * celcius) + 32)

      $.ajax({
        type:'GET',
        url:'https://fcc-weather-api.glitch.me/api/current?lat='+lat+'&lon='+long,
        success: function(weatherInfo){
          //var celcius = Math.floor(weatherInfo.main.temp)
          //var farenheit = Math.floor((1.8 * celcius) + 32) 
          var icon = '<img src='+ weatherInfo.weather[0].icon+'>'
          $('#weather').text(celcius+' C')
          $('#icon').html(icon) 
        },   
        error: function (){
          alert('weather API not responding')
        }

      });

  }

  function getLocation() {

      if(navigator.geolocation){
        navigator.geolocation.getCurrentPosition(getWeather);
      } else {
        alert('your browser does not support Geolocation')
        }
  }

  getLocation();

});
iso
@iso1048
@rafaelmonroy try declaring the variables outside the ajax call, then assigning the values to the variables inside success function of the ajax call.
rafaelmonroy
@rafaelmonroy
@gothamknight ohh ok, so just leave them as blank outside the call and declare the value inside the call?
iso
@iso1048

@rafaelmonroy outside the ajax call (declaration of variables):

var c;
var f;

inside the success function of the ajax call (assignment of the declared variables):

c = Math.floor(weatherInfo.main.temp);
f = Math.floor((1.8 * c) + 32);
rafaelmonroy
@rafaelmonroy
@gothamknight oh snap, didn't even know that was possible, let me try it out
rafaelmonroy
@rafaelmonroy
@gothamknight I tried console.log(celcius) returns as undefined
$(document).ready(function (){

  function getWeather(position) {

    var lat = position.coords.latitude;
    var long = position.coords.longitude;

    $.ajax({
      type:'GET',
      url:'https://maps.googleapis.com/maps/api/geocode/json?latlng='+lat+','+long+'&key=AIzaSyCwOc9_sxzQyW-U96Eg_2kiLsfwRxhkBf0',
      success: function(location){
        var city = location.results[0].address_components[2].long_name
        $('#city').text(city)
      }
    });

    var celcius;
    var farenheit;

    $.ajax({
      type:'GET',
      url:'https://fcc-weather-api.glitch.me/api/current?lat='+lat+'&lon='+long,
      success: function(weatherInfo){
        celcius = Math.floor(weatherInfo.main.temp)
        farenheit = Math.floor((1.8 * celcius) + 32) 
        var icon = '<img src='+ weatherInfo.weather[0].icon+'>'
        $('#weather').text(celcius+' C')
        $('#icon').html(icon) 
      },   
      error: function (){
        alert('weather API not responding')
      }
    });

    console.log(celcius)

  };

  function getLocation() {

      if(navigator.geolocation){
        navigator.geolocation.getCurrentPosition(getWeather);
      } else {
        alert('your browser does not support Geolocation')
        }
  }

  getLocation();

});
iso
@iso1048
@rafaelmonroy are you working on codepen?
rafaelmonroy
@rafaelmonroy
@gothamknight yeah
aRtoo
@artoodeeto
yow fam. i have this regex ^1?[- .]?\(?\d{3}\)?[- .]\d{3}[- .]\d{4}
its returning me some of the true except this
5555555555 should return true.
(555)555-5555 should return true
1(555)555-5555 should return true
and its returning me this false values.
555)-555-5555 should return false.
(555-555-5555 should return false.
trying to add \s? between the square brackets but nothing happens. any idea fam?
iso
@iso1048

@rafaelmonroy oh ok. What I did in my weather app was store the temperatures inside an element using the jquery .data() function (https://api.jquery.com/data/) - do this inside the success function of the ajax call.

$('#weather').data({
          f: farenheit,
          c: celcius
        });

try using the above after the variables are assigned. Then outside the success function, console.log this: $('#weather').data() to see the object.
hopefully that works. sorry for taking a long time to reply.

legendinraze
@legendinraze
how do I seperate my links and put them next to eachother? https://codepen.io/manny45/pen/GvPypQ?editors=1100
rafaelmonroy
@rafaelmonroy
@gothamknight no worries, thanks for me helping out. Im going to give that a shot