I have a very weird bug turn up in my code. I have a weather forecasting site I am building, it uses geolocation to find the city you reside in and then uses wunderground's API to give you the forecast. The problem is that when you search for a city manually using the search box, the forecast temperature returned in NAN, but when it uses your co-ordinates it returns correctly. I have no idea why this is happening.
I posted all the code up on JSBIN here : http://jsbin.com/agigeb/edit#javascript
I think it may have to do with how I extract the temperature from the string it is in (I don't use the integer temperatures it provides as it doesn't provide an integer temperature that changes based on the time of day, e.g. if it's the morning it returns the afternoon forecast and if it's the evening it returns the next morning's forecast)
That part is posted on this JSBIN here: http://jsbin.com/etupun/edit#javascript
Thank you in advance for any help, Jake.