butoremontas
Programmer
Hello,
i have this (look below), in IE "alert(this.src + counttuna);" loops good - from 1 to 8, but in FF or Chrome "alert(this.src + counttuna);" loops from 8 to 0 in , i can't find why.
My english isn't so good, so if need more explanation, i will do.
Thanks for any help.
function getImageUrl() {
var counttuna=0;
for (i = 1; i <= 8; i++)
{
var imgsrc = folder+file+(i)+'.gif';
var img = new Image();
img.onerror = function (evt) {
//alert(this.src + " can't be loaded.");
}
img.onload = function (evt) {
counttuna++
alert(this.src + counttuna);
}
if(img.src != imgsrc) { // don't get stuck in an endless loop
img.src = imgsrc;
}
}
if(i=8)
{
//loadsnowimagescount(counttuna);
alert(counttuna)}}
i have this (look below), in IE "alert(this.src + counttuna);" loops good - from 1 to 8, but in FF or Chrome "alert(this.src + counttuna);" loops from 8 to 0 in , i can't find why.
My english isn't so good, so if need more explanation, i will do.
Thanks for any help.
function getImageUrl() {
var counttuna=0;
for (i = 1; i <= 8; i++)
{
var imgsrc = folder+file+(i)+'.gif';
var img = new Image();
img.onerror = function (evt) {
//alert(this.src + " can't be loaded.");
}
img.onload = function (evt) {
counttuna++
alert(this.src + counttuna);
}
if(img.src != imgsrc) { // don't get stuck in an endless loop
img.src = imgsrc;
}
}
if(i=8)
{
//loadsnowimagescount(counttuna);
alert(counttuna)}}