if (_this.tiles["suz:SuzukiHubResponse"]["suz:categories"][category][aspect]["suz:image"][imageNo] != undefined) {
if (imageNo > (_this.tiles["suz:SuzukiHubResponse"]["suz:categories"][category][aspect]["suz:image"].length - 1)) {
imageNo = 0;
_this.categoriesCurrentImage[categoryIndex] = imageNo;
}
var img = _this.tiles["suz:SuzukiHubResponse"]["suz:categories"][category][aspect]["suz:image"][imageNo];
_this.showImage(img, divId);
_this.categoriesCurrentImage[categoryIndex]++;
_this.categoryIndex++;
} else {
if (imageNo > (_this.tiles["suz:SuzukiHubResponse"]["suz:categories"][category][aspect]["suz:image"].length - 1)) {
imageNo = 0;
_this.categoriesCurrentImage[categoryIndex] = imageNo;
}
var img = _this.tiles["suz:SuzukiHubResponse"]["suz:categories"][category][aspect]["suz:image"];
_this.showImage(img, divId);
_this.categoriesCurrentImage[categoryIndex]++;
_this.categoryIndex++;
}
谁能告诉我为什么。如果语句是真的,代码去其他地方?
我最终在else子句中,即使if为真? 这对我来说绝对没有意义。
如果在suz:image节点下面有超过1个图像,它应该落入else中。它有99%的时间。
你的代码格式不。解决这个问题,这个错误应该变得更加明显。 – zzzzBov
使用一些更多变量来使代码更易于阅读和调试。例如,把var img = _this.tiles [“suz:SuzukiHubResponse”] [“suz:categories”] [category] [aspect] [“suz:image”];更高,并在适当的测试中使用它。 –