News for hackers. Stuff that matters.
Re:Show HN: Simple JavaScript Weather Plugin with JQuery Dep... by dvh on Wednesday November 23, 2016 @10:04AM (#13023085)
I think the demo would be more readable when you would use JSON.stringify(data, undefined, 4) a put it in PRE element, with flat structure in plaintext it's indented randomly depending on the name of attribute which is kida kard to read, with JSON you see what belongs where, not to mention the rendering code would be much simpler, like this:

reallySimpleWeather.weather({location: 'Bend, OR', woeid: '', unit: 'f', success: function(w) { console.log(document.getElementById('weather').innerHTML = JSON.stringify(w, undefined, 4))} }); document.getElementById('weather').style.whiteSpace='pre';

There are no comments on this comment yet.