Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <div id="temp"></div>
  2. <script>
  3. $(document).ready(function(){
  4. var city = "Worthington, OH";
  5. var searchtext = "select item.condition from weather.forecast where woeid in (select woeid from geo.places(1) where text='" + city + "') and u='f'"
  6. //change city variable dynamically as required
  7.  
  8. $.getJSON("https://query.yahooapis.com/v1/public/yql?q=" + searchtext + "&format=json").success(function(data){
  9. console.log(data);
  10. $('#temp').html(data.query.results.channel.item.condition.temp + "F");
  11. $("#temp").hide().fadeIn(800);
  12.  
  13. });
  14.  
  15. });
  16. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement