Paul Tomblin Paul Tomblin - 2 years ago 62
Javascript Question

Possible to make AJAX call that doesn't return?

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?

Answer Source

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.

    url: "theURL",
    data: theData
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download