I try to execute an email request when a user leaves the page. The code I'm working with
<script type="text/javascript"> window.onbeforeunload = function(){ var used = $('#identifier').val(); $.post('conversation.php?leave=true',{ud:used}); } </script>
Is there something wrong with what I'm doing here? The result that I get in the FF error console just says that other unrelated functions / variables are not defined (since they are unloaded). Any tips or pointers on what I need to fix?
, AJAX beforeunload , , , , . , :
beforeunload
$.ajax({ type: "POST", url: 'conversation.php?leave=true', data:{ud:used}, async: false });
, , , , , . , , async: false .
async: false
Source: https://habr.com/ru/post/1776019/More articles:C # file / folder monitor - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1776015/programmatically-adding-uibuttons-and-uiimages-to-a-uiscrollview&usg=ALkJrhiyzaBai8dVlYPjX0kURgKUmypm5ghttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1776016/cocoa-touch-how-to-allow-mpmovieplayercontroller-but-no-other-views-to-autorotate&usg=ALkJrhjtVJBXdOTJHuZG17nkeq1O32bpAwHow to solve the hibernation problem: repeating column in mapping for an object? - javaIE меняет цвет моего изображения... а? - htmlSpecifying columns in jpql select causes fill error - javaNon-blocking io webserver / framework for java - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1776022/add-10-minutes-to-730am-php&usg=ALkJrhiv0z5V0NyTrZGiaEUJFWkEf28hfwAre there any free php scanners? - phpнапишите этот xml в С# - c#All Articles