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
mzedlach
@mzedlach
what's the difference.
Tyler Moeller
@TylerMoeller
Try it out - replace /conditions/ with /geolookup/ and see how the data prints differently
mzedlach
@mzedlach
I just don't understand HOW you get all this information from teh FCC lessons and from documentation.
it's just beyond me
It's seriously been a month I"ve been on this API stuff.
A month
and every time I sit down to figure thigns out, I end up more frustrated and more confused
Because every person I ask has a different way of doing it, it seems like.
I'm sorry, I'm venting. I'm just so frustrated.
Tyler Moeller
@TylerMoeller
The documentation is never geared for beginners unfortunately, so it's an iterative process of learning, trying, failing, learning from those failures, and moving forward.
mzedlach
@mzedlach
I'm just so lost with JSON that I don't even know where to place the console.log.
lol
:)
So, changing that bit to geolocation generates A LOT more information.
Tyler Moeller
@TylerMoeller
  $.getJSON(api, function(data) {

  });
Let's start with this above ^^ then, do you see the function(data)?
mzedlach
@mzedlach
yes :)
Tyler Moeller
@TylerMoeller
That's called an anonymous function
All the information that comes back from that URL gets stored in data
mzedlach
@mzedlach
okay
Tyler Moeller
@TylerMoeller
You can then do console.log(data) inside the anonymous function to view the information stored in the data variable
You can also write it to the <body> of your page like we're doing $('body').append(JSON.stringify(data))
mzedlach
@mzedlach
Okay, so... that line says .... from the api variable (which is a link) call on a function which removes all that data into a variable called data?
is that right?
Tyler Moeller
@TylerMoeller
So, it's more like:
  $.getJSON(api, function(data) {
   // do something with the information stored in the data variable
  });
mzedlach
@mzedlach
okay

So
$('body').append(JSON.stringify(data))

is the same as

$.getJSON(api, function(data) {
console.log(data)
});

in terms of.... it will print all the info in "data"

wait...
Tyler Moeller
@TylerMoeller
Yes, those are different ways of printing the data. One way adds it to the <body> element of your web page, the other way logs it to your browser console.
mzedlach
@mzedlach
okay
So, what is hte benefit of using this
$('body').append(JSON.stringify(data))
especially if all you need to work with is the data from taht json?
And, slightly unrelated ~~ the web info I gave you.. can peopel now see where I live based on the key code?
okay
Tyler Moeller
@TylerMoeller
No, only Weather Underground and Codepen Admins will know where you live
I'm sure they have better things to do :)
Lots of weather apps running on those servers
mzedlach
@mzedlach
LOL
So, I thought that THIS bit of code is what changes the text :
$("#data").html("latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude);
I mean, orginally that's what I though. Although, I'm thinking that's not the case anymore.
zamora88
@zamora88
For the Build a Personal Portfolio Webpage challenge, am I starting with blank template like the first challenge , Make a Tribute Page?
Tyler Moeller
@TylerMoeller
Yeah, that code isn't needed any more. You have one URL that gives you location + weather all in one
mzedlach
@mzedlach
@zamora88 Yes :) Unless you'd like to carry over things from your tribute page
@TylerMoeller So, how do I do it so that that string of code IS used?
So, wait... that entire IF statement is unecessary?
Tyler Moeller
@TylerMoeller
@mzedlach Remember the URL you had before that was always showing you california? You would replace the final two numbers at the end of that URL with position.coords.latitude and position.coords.longitude
That URL isn't needed any more though.
zamora88
@zamora88
@mzedlach Ok. Is it the same idea with the HTML, CSS, and JS boxes?
I don't see a link for a blank template to build the portfolio.