The code snippet below appears to be not displaying anything, despite the fact that it should be. There are no errors being highlighted by Firebug.
var assign = {
'href' : {
'.voteUp' : '?p=action&a=voteup&pid='+ value.PostPID,
'.voteDown' : '?p=action&a=votedown&pid='+ value.PostPID,
'.postImage a': '?p=user&uid='+ value.UserUID
},
'src' : {
'.postImage img' : value.UserImage
},
'html' : {
'.repCount' : value.PostRep,
'.postInfo .rep': value.UserRep,
'.postInfo .name': value.UserName,
'.postInfo .time': value.PostTime,
'.postMessage' : value.PostText
}
};
$.each(assign, function(type, data) {
switch (type)
{
case 'html':
$.each(data, function(handler, value) {
$('#'+ value.PostPID +' '+ handler).html(value);
});
break;
case 'href':
case 'src':
$.each(data, function(handler, value) {
$('#'+ value.PostPID +' '+ handler).attr(type, value);
});
break;
}
});
This portion of code is part of a larger script, with the remaining sections functioning properly (for instance, there is a function following this one that uses fadeIn
for various contents). If you don't spot any issues here, please leave your feedback above and I will include the complete script.
Thank you.