I'm using the beforeunload
event to try to send an ajax request to the server before the user leaves the page but it does not work very well.
Is there a way to send a request that continues to run on the server even though the browser window is closed? Maybe with socket, cURL?
Reason: I am doing a search and satisfaction form I would like that if the user closes the window and does not complete the search, save what has been replied so far