Are you adding the <a> anchor tags inside the #effect div? That would explain why this happens, because both(!) .click() handlers will react on one click of the anchor which results in replacing the original content and(!) inserting the new content etc etc.
Try to stop the propagation process from the anchor's click handler.