I have this piece of code
var temp = "text " + this.link + " text";
$(data.query.results.item).each(function () {
alert(temp);
});
When alerted it returns "text undefined text"
But if i do this
$(data.query.results.item).each(function () {
alert("text " + this.link + " text");
});
It returns the correct value
Why is this happening and how can i get it to work?
Thanks
tempis a global variable thenthiswould refer to thewindowobject.