Can anyone help me with this code??

Can anyone help me with this code??

i found this code on the internet. is taking info from the yahoo weather and is loading different image depends from the result here is my code. problem is not loading the image

  1.  <div class="wrap">
  2.             <!-- #Header Start -->
  3.                 <div class="header">
  4.                
  5.                        
  6.                         <!--Begin logo -->
  7.                         <div class="logo">
  8.  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
  9. <script type="text/javascript">
  10.                         $(document).ready(function() {   
  11. $.YQL = function(query, callback) {
  12.     var encodedQuery = encodeURIComponent(query.toLowerCase()),
  13.         url = 'http://query.yahooapis.com/v1/public/yql?q='
  14.             + encodedQuery + '&format=json&callback=?';
  15.     $.getJSON(url, callback);
  16. };
  17. $.YQL("select * from rss where url='http://weather.yahooapis.com/forecastrss?p=CYXX0005'",function(data){
  18.             var w=data.query.results.item;
  19.               var class=w.condition.text;
  20.               var encodedclass = class.replace(/\s+/g, '-').toLowerCase();
  21.               $('.logo').addClass(encodedclass);
  22.        });
  23. });
  24. </script>                       <br class="clear" />
  25.                        
  26.         
  27.                         </div>
  28.                         <!--End logo -->
and here is the css code

  1. .logo {
  2.     float:left;
  3.     font-size:11px;
  4.     background-image: url(logo.png) no-repeat;
  5. }
  6. /* weather logo */
  7. .logo.cloudy, .logo.partly-cloudy, .logo.mostly-cloudy {
  8.     background-image: url(images/logocloud.png) no-repeat;
  9. }
  10. .logo.rain, .logo.thunderstorms, .logo.drizzle, .logo.showers, .logo.thundershowers, .logo.scattered-showers, .logo.scattered-thunderstorms, .logo.isolated-thunderstorms {
  11.     background-image: url(images/logorain.png) no-repeat;
  12. }
  13. .logo.sunny, .logo.fair, .logo.hot {
  14.     background-image: url(images/logo.png) no-repeat;
  15. }
  16. .logo.snow, .logo.mixed-rain-and-snow, .logo.mixed-rain-and-sleet, .logo.snow-flurries, .logo.light-snow-showers, .logo.blowing-snow, .logo.hail, .logo.sleet, .logo.snow-showers, .logo.heavy-snow {
  17.     background-image: url(images/logosnow.png) no-repeat;
  18. }




    • Topic Participants

    • g3o