Quantcast
Channel: User Ryan - Stack Overflow
Viewing all articles
Browse latest Browse all 16

window.onbeforeunload performing query

$
0
0

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?


Viewing all articles
Browse latest Browse all 16

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>