My Weather Application. Review Please!

My Weather Application. Review Please!
0

#1

Here is my weather application.Please tell me how it is. and if you can help me that how to include the state name in this application along with city.Link


#2

Hi, @ShwetaRajput. You could make this such as it shows weather information on page load. You don’t have to request for location every time a user clicks °C or °F; you can just convert the temperature via JS.


#3

BIG +1 on making sure it doesn’t do an API call with the temperature change. I would also add this to your body declaration in CSS:

background-repeat: no-repeat;
background-size: cover;

Looks great, otherwise! You seem to be plowing through these projects at a good pace.


#4

I did what you suggested. now you can check again.and please help if you can that how to add state and country name to it?


#5

It does request for location at page load, but it’s still requesting when I click °F or °C.

You may want to refer to the documentation of the API that you used.


#6

Well i used the API request at °F and °C buttons so that we can see temperature in both f and c. Else i would have to create an conversion function.


#7

A conversion function is definitely better than a new API call. You did the temperature conversion exercise in the challenges, right?


#8

Yes i did. Okay will try.ThankYOU


#9

Now you can have a look. And tell me if what i did is right or wrong?


#10

Yep it works :thumbsup:!


#11

Thank You for the suggestions.They worked because of you only.


#12

One more thing my weather app sometimes show my location, sometimes it show nearby location,or a location which is far away. Why That happens?


#13

I’m not sure, to be honest (I haven’t started my weather app yet), but my guess is that it’s API-related.
In my case your weather app (and most weather apps I try that request for my location) gives me my neighboring town’s weather, but I don’t mind because I am closer to that town’s center than to my own town’s center.


#14

I am looking for a more efficient way to toggle between Celsius and Fahrenheit - this is my initial setup…

var f2c = [c + '\xB0' + " " + "Celsius", f + '\xB0' + " " + "Fahrenheit"]; var i = 0; $("#button").click(function (){ i = (i + 1) % f2c.length; $("#temp").html(f2c[i]);

It works but is there a better method?


#15

What do you think about my code. I used different way.


#16

for some reason- codeine will not let me use navigator.geolocation …