No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
AJAX Proxy
AJAX Toolkit provides an AJAX proxy for browsers with external services limitations.
Some browsers don't allow JavaScript code to connect to external
servers directly. Therefore, you may need to send requests through
the AJAX proxy.
The AJAX proxy is part of the AJAX Toolkit. Access it using remoteFunction defined in connection.js. You can specify any HTTP method in remoteFucntion, for example HTTP GET or POST, and it will be forwarded to the external service.
The following examples illustrate typical approaches for GET and POST:
GET Example:
1sforce.connection.remoteFunction({
2 url : "http://www.myExternalServer.com",
3 onSuccess : function(response) {
4 alert("result" + response);
5 }
6 });POST Example:
1var envelope = ""; //request envelope, empty for this example
2 sforce.connection.remoteFunction({
3 url : "http://services.xmethods.net:80/soap",
4 requestHeaders: {"Content-Type":"text/xml",
5 "SOAPAction": "\"\""
6 },
7 requestData: envelope,
8 method: "POST",
9 onSuccess : function(response) {
10 sforce.debug.log(response);
11 },
12 onFailure : function(response) {
13 alert("Failed" + response)
14 }
15 });