This works (in firefox but not ie):
document.getElementById(filename+'Likes').innerHTML=result;
document.getElementById(filename+'Like').setAttribute('class','hideGalleryLike');
document.getElementById(filename+'Dislike').setAttribute('class','hideGalleryLike');
I thought the jquery code should be:
$('#'+filename+'Likes').html(result);
$('#'+filename+'Like').attr('class','hideGalleryLike');
$('#'+filename+'Dislike').attr('class','hideGalleryLike');
But it doesn’t work. ‘filename’ always starts with the username of the person who uploaded the file, which in turn always starts with a letter. I am aware of other ways of changing the class, but it seems that it is the dynamic selector that is the issue.
It works as espected at jsfiddle: http://jsfiddle.net/7bQfE/
So I think something else is wrong.
$(document).ready()function?filenameas you espected (console.logthe var and looks if it is so)?