vendredi 29 mai 2015

Method is returning undefined

I have a piece of JS code in for loop:

window.gamesParse = {
    days: days,
    dates: dates,
    times: times,
    series: series,
    homes: homes,
    aways: aways,
    channels: channels
}

var image = $.get("assets/images/" + gamesParse.aways[i] + ".png");
if (image.status !== 404) {
    console.dir(image);
} else {
    console.dir(image);
}

Now, it returns the right Objects which have status property. But if I change image to image.status (or any other property or method), it returns undefined.

Aucun commentaire:

Enregistrer un commentaire