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
Gulsvi
@gulsvi
@Na-Ya I can try to help - can you show your code?
I'm working on the ajax request but despite everything I tried it keeps telling me that lat is not defined
@SkyC0der any tips would be appreciated
Gulsvi
@gulsvi
@Na-Ya Your lat and long are only defined inside your function(position), if you want to use them outside of that, you'll need to pass them as arguments to another function
 if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(function(position) {
    var lat = position.coords.latitude;
    var long = position.coords.longitude;
    getWeather(lat, long);
  });
}

function getWeather(lat, long) {
  $.ajax({
    url: "https://api.darksky.net/forecast/<<<your key>>>/" + lat + "," + long,
    dataType: "jsonp"
  }).done(function(data) {
    console.log("has data arrived?", data);
  }); //closes out ajax
}
Na-Ya
@Na-Ya
oh wow, thanks that makes a lot of sense
thanks for taking a look @SkyC0der
CamperBot
@camperbot
na-ya sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 1758 | @skyc0der |http://www.freecodecamp.com/skyc0der
Gulsvi
@gulsvi
@Na-Ya I messed up your ajax call - fixed in the sample above
Na-Ya
@Na-Ya
@SkyC0der now I am getting a 'Access-Control-Allow-Origin' error :/
Gulsvi
@gulsvi
@Na-Ya Are you using dataType: 'jsonp'?
Na-Ya
@Na-Ya
@SkyC0der when I tried adding the dataType as jsonp the lat and long returned undefined
Gulsvi
@gulsvi
@Na-Ya You are getting close, but your ajax syntax is incorrect. Compare to what I provided in the code sample above
your function(data) is in the wrong place
Panayiotis Mangafas
@mangafas
hey im having a problem with "Create a Media Query" this is my code, it works on the phone at the right but it doesnt get accepted by fcc
<style>
  p {
    font-size: 20px;
  }

  /* Add media query below */
  @media (min-height: 800px){
    #par{
      font-size: 10px;
    }
  }


</style>

<p id="par">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem. Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.</p>
Na-Ya
@Na-Ya
ok @SkyC0der , thanks for your help, I will review the documentation and try to correct my ajax syntax
CamperBot
@camperbot
na-ya sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:warning: na-ya already gave skyc0der points
Gulsvi
@gulsvi
@mangafas @media (min-width: 800px)
Not min-height
akshayscu
@akshayscu
hi guys i was going trhu algos in FE section
i am stuck...
var str = "si eye is";
var trimit = str.replace(/+s/g,"");
console.log(trimit);
gives result "si eye is" but not "sieyeis", any thoughts?
Gulsvi
@gulsvi
@akshayscu I think you mean \s instead of +s
var str = "si eye is";
var trimit = str.replace(/\s/g,"");
console.log(trimit);
I use this site for help with regular expressions - there's a cheat sheet on the right-hand side: http://www.regexpal.com/
akshayscu
@akshayscu
gotcha @SkyC0der ...haha!!...thanks for the help
typo
onikroo
@onikroo
Finally completed the basic front end project. Happy!
guru prasad
@guruprasad8212
hi guys
onikroo
@onikroo
Hi
guru prasad
@guruprasad8212
having troube with random quote machine

$(document).ready(function(){
function getNewQuote(){
$.ajax({
url:"http://api.forismatic.com/api/1.0/",
jsonp:"jsonp",
dataType:"jsonp",
data:{
method :"getQuote",
format:"jsonp",
lang:"en"
},

    success:function(response){
        console.log(response.quoteText);
    }
});

}
getNewQuote();
});

when i load the page in chrome i get[ Uncaught SyntaxError: Unexpected token < ]
do ul know what is causing the error
Ashley Owens
@yelhsa
is there a way to make background-image:url("") show the full image even if there isn't enough stuff to use up all the space?
Ashley Owens
@yelhsa
nvm i got it. :)
CallMeOrange
@EgnaroDev
@SkyC0der hey
Do you know how to make a list/menu where you can go to different pages
@yelhsa use background-size: cover;
So the image will fit perfectly to any screen
Gulsvi
@gulsvi
@MCTwoDigitZero Yeah, like a navbar?
CallMeOrange
@EgnaroDev
@SkyC0der kinda
Like one symbols with three lines you click it you can choose different page
Cato Myhre
@Zalmez
can anyone give me some feedback? going to re-size the portfolio images a little bit to make it fit better