title: jQuery variable inside .each() function
body: <p>I have this piece of code</p>
  
  <pre><code>var temp = "text " + this.link + " text";
  
  $(data.query.results.item).each(function () {
      alert(temp);
  });
  </code></pre>
  
  <p>When alerted it returns "text undefined text"</p>
  
  <p>But if i do this</p>
  
  <pre><code>$(data.query.results.item).each(function () {
      alert("text " + this.link + " text");
  });
  </code></pre>
  
  <p>It returns the correct value</p>
  
  <p>Why is this happening and how can i get it to work?</p>
  
  <p>Thanks</p>