如果 sendMessageAppendData() 已在当前 js 会话中执行,我将如何防止 sendMessageAppendData() 被添加到“newMessageSpace”ID。
function sendMessageAppendData() {
return '<table id="newMessageBox1" cellpadding="0" cellspacing="0" style="border-radius: 3pt; width: 267px; border: 1px solid #CCCCCC">'+
'<tr>'+
'<td valign="top" class="font1" style="text-align: center; padding: 3pt">You are messaging <?php echo $row->firstname." ".$row->lastname ?></td>'+
'</tr>'+
'<tr>'+
'<td valign="top" style="text-align: center; width: 253px; padding: 3pt">'+
'<input autofocus placeholder="Type your message" id="responseMessage" spellcheck="false" autocomplete="off" class="textbox1" type="text" style="width: 185pt; height: 17px" /></td>'+
'</tr>'+
'</table>';
}
$('#clickSendAMessage').live('click', function() {
$('#newMessageSpace').prepend(sendMessageAppendData());
});