I'm trying to perform a post query when the user leaves the page. The code I'm working with is
<script type="text/javascript">window.onbeforeunload = function(){ var used = $('#identifier').val(); $.post('conversation.php?leave=true',{ud:used});}</script>
Is there anything wrong with what I'm doing here? The result I get in the FF error console is just saying that other non-related functions/variables are not defined (since they are unloading). Any tips or pointers for what I need to fix?