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
kirbyedy
@kirbyedy
@Akashd7 using that library will also solve your problem, as far as I can see :)
Akash.D
@Akashd7
woahg thanks
it worked
Prakash Shiwakoti
@pshiwakoti1
@donofriov you are still there. can i ask you that question
kirbyedy
@kirbyedy
@donofriov at the moment bootstrap 4 is in the alpha stage, so problems might occur, but if you can help him solve the problem he is facing using bs 4 that will be great
Akash.D
@Akashd7
@donofriov will try the new library too
@kirbyedy thanks again :)
CamperBot
@camperbot
akashd7 sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1827 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
Vincent D'Onofrio
@donofriov
yeah very good point @kirbyedy
adding these classes to an img for bootstrap 4 work as well :)
<img class="mx-auto d-block"
Prakash Shiwakoti
@pshiwakoti1
hi vincent will you please look at my CodePen? http://codepen.io/pshiwakoti1/pen/YZKPRx?editors=1112
Vincent D'Onofrio
@donofriov
@pshiwakoti1 do you want to get your city from your first api or the second api?
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