So I have a function that gets called when you press an arror which will update 16 img src attributes. Odd thing is, it loads them properly, however, the checkboxes which determines if a client/user likes, or in this case makes them a favorite doesn’t update or even load the initial set. I was wondering what was wrong. Any ideas?
Firebug tells me its the line with the *****
[CODE]function updateThumbnails()
{
var i = (currentPage-1)*16;
var x = 0;
if( currentPage != totalPages )
{
for( i; i < i+16; i++ )
{
x = i-(16*(currentPage-1));
******document.getElementById( “tb_” + x ).src = thumbnail_dir + thumbnails[i];*******
document.getElementById( “fav_” + x ).disabled = false;
document.getElementById( “fav_” + x ).style.display = ‘inline’;
document.getElementById( “fav_” + x ).checked = false;
if( favorites[i] )
{
document.getElementById( “fav_” + x ).checked = true;
}
}
}
else
{
for( i; i < thumbnails.length; i++ )
{
x = i-(16*(currentPage-1));
document.getElementById( “tb_” + x ).src = thumbnail_dir + thumbnails[i];
document.getElementById( “fav_” + x ).checked = false;
if( favorites[i] )
{
document.getElementById( “fav_” + x ).checked = true;
}
}
for( var k = thumbnails.length % 16; k < 16; k++)
{
document.getElementById( “tb_” + k ).src = “http://www.roderickpena.com/images/layout/blank.png”;
document.getElementById( “fav_” + k ).disabled = true;
document.getElementById( “fav_” + k ).style.display = ‘none’;
}
}
}