Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 19 2020 20:09
    @krisb1220 banned @Gastony
  • May 14 2020 22:39
    @bjorno43 banned @minitechtips_twitter
  • May 14 2020 22:38
    @bjorno43 banned @real-action
  • Feb 01 2020 00:27
    @bjorno43 banned @Ndoua
  • Jan 07 2020 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 2019 17:13
    @mstellaluna banned @cmal
  • Jan 08 2019 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
Mooli
@Mooli88
whats the difference between '@media print and (min-resolution: 300dpi) {...}' to '@media only print and (min-resolution: 300dpi) {...}'?
mjqblade
@mjqblade
@Mooli88 almost everythimg]]
@EdnaMode no
Ednacode (New to Github and making mistakes)
@EdnaMode
@mjqblade im new here so can you cut and paste the question fm the map and i will see if i have answered that
mjqblade
@mjqblade
i didnt
Mooli
@Mooli88
@mjqblade please be more specific
mjqblade
@mjqblade
@Mooli88 i dpnt know much but i know there diffrent becuase in one your asking something]
kamil kawa
@GlaDdos
Ednacode (New to Github and making mistakes)
@EdnaMode
@mjqblade exact question pls
?
mjqblade
@mjqblade
what
kamil kawa
@GlaDdos
i know it's not showing API responce yet, i'm trying to figure out why global variables are not storing values that are assigned to them in navigator.geolocation.getCurrentPosition(function(position) <- this place
Ednacode (New to Github and making mistakes)
@EdnaMode
what is the question on Map so i can locate it
mjqblade
@mjqblade
Use Responsive Design with Bootstrap Fluid Containers
greg
@wearenotgroot
@GlaDdos

$(document).ready(function(){
var weatherAPIKey = "6a8f3fff2528a34f3bc0896626b63742";
var longitudeQuery = 0;
var latitudeQuery = 0;
var weatherAPIQuery = "";
  if(navigator.geolocation){
    navigator.geolocation.getCurrentPosition(function(position){
          longitudeQuery = position.coords.longitude;
          latitudeQuery = position.coords.latitude;
console.log(longitudeQuery);
          weatherAPIQuery = "http://api.openweathermap.org/data/2.5/weather?lat=" + latitudeQuery + "&lon=" + longitudeQuery +'&appid=' + weatherAPIKey;

console.log(longitudeQuery);


      $.getJSON(weatherAPIQuery).done(function(weather){
          console.log(weather);
        })
        .fail(function(){
          console.log("error");
        });
    });

  }




});
Bruce Young
@mutantspore
@GlaDdos as has already been said. the process is asychonous .. the geolocation process gets started but you don’t know when it wil finish.. teh actual JS code just keeps rolling on and gets to teh bit outside the geolocate and well.. nothing has return yet.
kamil kawa
@GlaDdos
@mutantspore Oooooh...
greg
@wearenotgroot
@GlaDdos as said earlier to make sure that the longitude and latitude are set before making request to the openweather api you either set a timeout on the getJSON or do it inside the getCurrentPosition callback
Clark Arnold
@clarkarnold
@mutantspore @wearenotgroot I am working on the same project.. How do you control when the next part fires? I am getting my Coordinates but I can't figure out how to tell the rest of the code to wait for that part to happen first
Bruce Young
@mutantspore
either do it as @wearenotgroot has suggested or wrap your getjson in a function ..say.. getWeather and call it from inside the geolocation
greg
@wearenotgroot
@GlaDdos and as @mutantspore said you need to add the appid
kamil kawa
@GlaDdos
thatks you guys i get that now @mutantspore @wearenotgroot
i meant thanks @mutantspore @wearenotgroot
CamperBot
@camperbot
gladdos sends brownie points to @mutantspore and @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 869 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
:star: 1129 | @mutantspore | http://www.freecodecamp.com/mutantspore
Bruce Young
@mutantspore
@clarkarnold as we just mentioned.. call the second part from within the first
Ednacode (New to Github and making mistakes)
@EdnaMode
@mjqblade @mjqblade this worked for me
<div class =" container-fluid">


<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>

<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</div>
dont forget the closing div at the bottom
that caught me out
mjqblade
@mjqblade

need help

greg
@wearenotgroot
@clarkarnold remember scope also no need to stringify anything just get it directly on json parameter
var arr;
var url;
var lat; 
var lon;
var str;

if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
    $("#data").html("latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude);
    lon = position.coords.longitude;
    lat = position.coords.latitude;
    url = "http://api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&appid=44db6a862fba0b067b1930da0d769e98&units=imperial";
    runFun(); //<---------------as mentioned call this here to insure the lat and lon are set
  });

}



function runFun() {
  $.getJSON(url, function(json) {
    console.log(json);
    arr = json; //<-------------no need for  this
    str = JSON.stringify(json); ///<-----------no need for this
//move here to reach the json/data
    $("#test").html("City: " + json.name + "<br>Temp: " + json.main.temp + "<br>Wind: " + json.wind.speed + " MPH from " + json.wind.deg + " degrees" + "<br>Weather Conditions: " + json.weather[0].main);

  });
  //<---------------couldnt reach the variable from here move it up
};
Ednacode (New to Github and making mistakes)
@EdnaMode
@mjqblade @mjqblade just sent help to you
cant u not see code???
mjqblade
@mjqblade
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

  .smaller-image {
    width: 100px;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>

<p>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<form action="/submit-cat-photo">
  <label><input type="radio" name="indoor-outdoor"> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  <label><input type="checkbox" name="personality"> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Crazy</label>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>

help level 74 or Use Responsive Design with Bootstrap Fluid Containers

Clark Arnold
@clarkarnold
@wearenotgroot OK I will give that a try thanks!
CamperBot
@camperbot
clarkarnold sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:warning: clarkarnold already gave wearenotgroot points
greg
@wearenotgroot
@clarkarnold :+1:
@mjqblade re-read instruction
@mjqblade where is the <link> for bootstrap!!!!!
@mjqblade from instruction:
You can add Bootstrap to any app just by including it by adding the following code to the top of your HTML:

<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>
@mjqblade add that on the top of the page
Clark Arnold
@clarkarnold
@wearenotgroot Got it working now thanks again
CamperBot
@camperbot
clarkarnold sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:warning: clarkarnold already gave wearenotgroot points
greg
@wearenotgroot
@clarkarnold :+1:
wyattelliott
@wyattwade
Finally fixed it up a bit. At least that one chunk of code. Couldn't have done it without you thanks again man @h4r1m4u . Have a good night