I’ve got form information captured and have built a URL to another website. How do I actually send that from javascript.
[theotherwebsiteUrl]?parama=A¶mb=B¶mc=C
This is the format I have built as a string into a variable called body.
I want ‘some JS function’ to send the contents of body to [theotherwebsite].
Their server is geared to accept this string and parse if from my website. I just don’t know what function to use to ship off an entire url string variables and all now that I concatenated the string to their format.
Thank you!
You “send information you another website” by loading a URL (sending an HTTP request), either directly in the browser or through Ajax. You can attach GET parameters to that URL or send POST data along with it.
For example:
or:
Note: sending a request through Ajax to a different server requires the remote server to be set up to receive it – see How do I send a cross-domain POST request via JavaScript?
Or cheat a bit, using JSONP: http://en.wikipedia.org/wiki/JSONP