title: $ var declaration in Javascript
body: <p>How should I declare an object variable in Javascript? By mistake, I thought I was in PHP and it worked.</p>
  
  <pre><code>$(res.data).each(function(index, value){
                      $src = value.images.fixed_height;
                      $('&lt;a href="'+value.url+'" target="_blank"&gt;&lt;img src="' + $src.url + '" width="' + $src.width +'" height="' + $src.height + '"&gt;&lt;/a&gt;').load(function(){
                          $(this).appendTo("#results").fadeIn();
                      })
                  });
  </code></pre>
  
  <p>Then, when I tried to think in terms of Javascript it didn't work,</p>
  
  <pre><code>$(res.data).each(function(index, value){
                      var src = value.images.fixed_height;
                      $('&lt;a href="'+value.url+'" target="_blank"&gt;&lt;img src="' + src.url + '" width="' + src.width +'" height="' + src.height + '"&gt;&lt;/a&gt;').load(function(){
                          $(this).appendTo("#results").fadeIn();
                      })
                  });
  </code></pre>