$(postElements).each(function() {
postElement = this;
if ($(postElement).hasClass("new")) {
- $.getJSON("ajax/markPostAsKnown.ajax", {"formPassword": getFormPassword(), "post": getPostId(postElement)}, function(data, textStatus) {
- $(postElement).removeClass("new");
- });
+ (function(postElement) {
+ $.getJSON("ajax/markPostAsKnown.ajax", {"formPassword": getFormPassword(), "post": getPostId(postElement)}, function(data, textStatus) {
+ $(postElement).removeClass("new");
+ });
+ })(postElement);
}
});
markReplyAsKnown($(postElements).find(".reply"));
$(replyElements).each(function() {
replyElement = this;
if ($(replyElement).hasClass("new")) {
- $.getJSON("ajax/markReplyAsKnown.ajax", {"formPassword": getFormPassword(), "reply": getReplyId(replyElement)}, function(data, textStatus) {
- $(replyElement).removeClass("new");
- });
+ (function(replyElement) {
+ $.getJSON("ajax/markReplyAsKnown.ajax", {"formPassword": getFormPassword(), "reply": getReplyId(replyElement)}, function(data, textStatus) {
+ $(replyElement).removeClass("new");
+ });
+ })(replyElement);
}
});
}