Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
59
rated 0 times [  63] [ 4]  / answers: 1 / hits: 20090  / 12 Years ago, thu, september 20, 2012, 12:00:00

Is it possible to send an jQuery.ajax call or equivalent without any sort of response? I want to trigger something on the server as I leave the page with the onbeforeunload command, but it's not something I need to feedback to the client, so I just want to send off the command and not wait for a response.



Is that possible?


More From » jquery

 Answers
26

Every request has a response. Even if the server throws an error a response is coming back with the error.



You can ignore the response if you like to just don't add a success callback.



$.ajax({
url: theURL,
data: theData
});

[#82986] Wednesday, September 19, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
adilene

Total Points: 395
Total Questions: 88
Total Answers: 109

Location: Indonesia
Member since Tue, Aug 3, 2021
3 Years ago
;