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
Prakash Shiwakoti
@pshiwakoti1
second api
Vincent D'Onofrio
@donofriov
what’s the name of the field in the second api?
Prakash Shiwakoti
@pshiwakoti1
name
data.name doesn't do it
Vincent D'Onofrio
@donofriov
hmm really?
Prakash Shiwakoti
@pshiwakoti1
yes
there are few variables that are not displaying
maybe I did it incorrectly
Will you please check for me?
Vincent D'Onofrio
@donofriov
data.name works for me :)
you are on the right track!
Prakash Shiwakoti
@pshiwakoti1
Why its not showing in my then
Vincent D'Onofrio
@donofriov
can you send me the line where you tried data.name, it may be a typo in your queryselector
Prakash Shiwakoti
@pshiwakoti1
document.querySelector('#temp1').innerText = data.weather[0].main; document.querySelector('#temp2').innerText = data.main.temp; document.querySelector('#temp3').innerText = data.weather[0].pressure; document.querySelector('#temp4').innerText = data.coord.lon; document.querySelector('#temp5').innerText = data.coord.lat;
Vincent D'Onofrio
@donofriov
right
so now you need to make one for data.name
Prakash Shiwakoti
@pshiwakoti1
i tried that
didn't work
but not all these above variables are priting values
Vincent D'Onofrio
@donofriov
try the line again and paste it here
Prakash Shiwakoti
@pshiwakoti1
only 2 of them are
kirbyedy
@kirbyedy
@pshiwakoti1 those lines have error
temp3 temp4 temp5
Prakash Shiwakoti
@pshiwakoti1
document.querySelector('#temp6').innerText = data.name;
kirbyedy
@kirbyedy
you defined them as a class in your html, yet you are referring to them as they were id in your js
that # means ID in html, which you dont have
you have a class defined on them
Vincent D'Onofrio
@donofriov
so that’s correct @pshiwakoti1 but like @kirbyedy you need to make sure they are aligning with what you are writing in your HTML
Prakash Shiwakoti
@pshiwakoti1
How to correct it
Vincent D'Onofrio
@donofriov
the # in your querySelector means you are looking for an id, but your div is set to class=“temp3”
kirbyedy
@kirbyedy
@pshiwakoti1 this is wrong as well: data.weather[0].pressure;
Vincent D'Onofrio
@donofriov
oops good catch @kirbyedy
i didn’t read close enough
that’s coming back as undefined after you updated your div to id=“temp3” because pressure isn’t under weather in your JSON response
Prakash Shiwakoti
@pshiwakoti1
i changed it to data.weather.pressure
Vincent D'Onofrio
@donofriov
but it’s under “main"
Oladapo Ademola
@Aoladapo
Good Morning, please i need assist with this, having trouble using jquery to set the css esp the background below is the code

///<body>
<script>
$(document).ready(function(){
$(".container").css("background-color","gray");

});

</script>
<div class="container">
<header>
<div class="">
<h1>Chief Obafemi Awolowo</h1>
<img src="https://cdn.gdn.ng/wp-content/uploads/2016/08/awolowo-640x360.jpg" align="middle">
<h4 id="tribute name">Chief Obafemi Awolowo (1909-1987) was a Nigerian nationalist, a political leader, and a principal participant in the struggle for Nigerian independence</h4>

            </div>
        </header>

            <div class="list">
                <ul>
                  <li><b>1909</b> Born in Ikenne, Western State, Nigeria</li>
                  <li><b>1944</b> Completed a University of London Correspondence course for bachelor of commerce degree </li>
                  <li><b>1944 - 1946</b> Completed a University of London course in Law degree </li>
                  <li><b>1947</b> Returned to Nigeria to practice Law and based in Ibadan </li>
                  <li><b>1950 - 1951</b> Founded and organised The Action Group Political Party that called for the immediate termination of the british rule  </li>
                  <li><b>1954</b> Became the first premier of the western region</li>

                </ul>
            </div>
          <div class="citation">
            <cite>"I have come to learn, from personal experience, that failure and defeat always serve as springboards for greater achievements for I, whom who never acknowledges their potency, and who is prepared to meet the challenges posed by' them - for they always pose challenges.<span>Chief Obafemi Awolowo</span></cite>
          </div>

        <footer>
          <p>Read more about Chief Obafemi Awolowo <a href="https://en.wikipedia.org/wiki/Obafemi_Awolowo" target="_blank">HERE</a>

        </footer>
</div>

</body>

Vincent D'Onofrio
@donofriov
so you want to be looking for data.main.pressure
Prakash Shiwakoti
@pshiwakoti1
I got it @donofriov
now Im getting all values
Vincent D'Onofrio
@donofriov
@pshiwakoti1 did you go through the API challenges on FreeCodeCamp?
Prakash Shiwakoti
@pshiwakoti1
I don't know how to put captions to each data
yes I did
Vincent D'Onofrio
@donofriov
and all the HTML and CSS stuff too?
Prakash Shiwakoti
@pshiwakoti1
yes I have
Vincent D'Onofrio
@donofriov
You should references all of those because they help you put together everything you need for these projects
for example you could do something like this
Prakash Shiwakoti
@pshiwakoti1
sure @donofriov thanks for your help