Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the used objects given by the innerHTML code? #1

Closed
dirsigler opened this issue Feb 1, 2019 · 3 comments
Closed

How to change the used objects given by the innerHTML code? #1

dirsigler opened this issue Feb 1, 2019 · 3 comments

Comments

@dirsigler
Copy link

Hey buddy,

thanks for this beautiful homepage.
I am trying to change the openweather API to the darksky one.

Somehow I am not able to change the strings which are given to the innerHTML stuff from the JSON output.

The output of the JSON is:

{
"latitude": 51.11919,
"longitude": 6.951266,
"timezone": "Europe/Berlin",
"currently": {
"time": 1549020317,
"summary": "Mostly Cloudy",
"icon": "partly-cloudy-day",
"precipIntensity": 0,
"precipProbability": 0,
"temperature": 3.62,
"apparentTemperature": 0.06,
"dewPoint": 1.04,
"humidity": 0.83,
"pressure": 990.58,
"windSpeed": 4.18,
"windGust": 6.4,
"windBearing": 146,
"cloudCover": 0.78,
"uvIndex": 1,
"visibility": 11.1,
"ozone": 354.99
},
"offset": 1
}

what I do now is:

document.getElementById("temp").innerHTML = json.currently.temperature;//.toFixed(0) + " C";

But somehow it is blank on the homepage.
Can you give me please a hint where I have to look?

@Jaredk3nt
Copy link
Owner

Could you post a gist of your index.html so I can run it? It looks fine to me from what you have explained.

@dirsigler
Copy link
Author

https://gist.github.com/0xE02B7/0545ebbf0e9f5b318279bdb64ab50b61

Here it is. I am not a dev, that's why I have to ask this noobish question. But I really appreciate the clean code and given features and want to use this as a base to mix my own feature set into this application.

Thanks in advance!

@d7eeem
Copy link

d7eeem commented Dec 25, 2019

Thank YOU very so much, this HomePage is amazing but i am having the same problem! :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants