How to send a URL request to a server without expecting a response back in Javascript
I am using a VoIP softswitch. In order to trigger a call I have to send the call parameters (user/pass/phone#) via http to a URL without be开发者_如何学JAVAing redirected to that URL. I tried JavaScript FORM with GET but I had no success.
The request is not really relevant, the response is:
When the server responds with a 204 No Content (instead of the usual 200 OK), the browser stays on the original page. See e.g. this.
You should use an asynchronous request (AJAX).
This is substantially easier if you use a framework that provides the facility, for instance jQuery. Or you can do it directly, find a good tutorial (example).
精彩评论