Hello, i want to optimize my code.
Example: $(document).ready(function() { $('.message_subject').click(function() { var msgBox = $(this).parent().parent().parent(); var msgID = msgBox.attr('id'); msgBox.find('.message_text').slideToggle('normal'); msgBox.find('.message_options').find('.message_deletestatus').html('ungelesen'); $.post('/pms/ajaxControl', { msgID: msgID, job: 'setStatus' }); msgBox.find('.message_status').after().html('<img src="/img/icons/ email_open.png" />'); msgBox.children('.message_user').children('p').children('.message_subject').css('font- weight', 'normal'); }); }); It's for a private message system. On click at the message subject, the message text get shown and and ajax call set the status for "read" about the ajaxControl into the database. But that happens for every click, but the status can set only 1 times. Can you help me to find a way to just allow ONE post the ajaxControl, nothing else ? Thanks alot