Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="temp"></div>
- <script>
- $(document).ready(function(){
- var city = "Worthington, OH";
- var searchtext = "select item.condition from weather.forecast where woeid in (select woeid from geo.places(1) where text='" + city + "') and u='f'"
- //change city variable dynamically as required
- $.getJSON("https://query.yahooapis.com/v1/public/yql?q=" + searchtext + "&format=json").success(function(data){
- console.log(data);
- $('#temp').html(data.query.results.channel.item.condition.temp + "F");
- $("#temp").hide().fadeIn(800);
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement