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
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.
mzedlach
@mzedlach
@zamora88 Go into your codepen, click on the box head on teh top right and select "new pen"
@TylerMoeller I don't understand what that means.
Tyler, than you for all of your help.
zamora88
@zamora88
@mzedlach Gotcha. Just found it.
@mzedlach Did you learn code on this program?
mzedlach
@mzedlach
I was going to go along with that video because it was something that I thought could help me from start to finish. I think I just need one show-me-exactly-how-to-do-everything-from-start-to-finish video or guide and it will help me get out of this rutt of non-comprehension. @TylerMoeller
Tyler Moeller
@TylerMoeller
@mzedlach When you were using navigator.geolocation, it returned your Latitude and Longitude
zamora88
@zamora88
I don't see how someone is suppose to be equipped to build a portfolio page with only the training up to this point.
mzedlach
@mzedlach
@TylerMoeller right and I was going with that becuase its' what htey taught us.
I know there are A LOT of differnet ways to do things~ that's where I get hung up with these challenges.
Tyler Moeller
@TylerMoeller
Just like we got all the weather information in a data variable, you got latitude and longitude in a position variable.
mzedlach
@mzedlach
right
zamora88
@zamora88
Has anyone one here done the "Build a Personal Portfolio Webpage" challenge?
mzedlach
@mzedlach
@TylerMoeller Reallly, thank you so much for all the help. I would send a hundred cookies if I could.