Make a request to the given url using the given method and parameters.
Parameters
| url | (string) The URL of the page to request. |
| options | (object) An object containing various options used by this method. Defaults to an empty object |
The structure of the options parameter, if given, should look like the following:
Object(
method: {
(string) The method to use to make the request. This should
be either "GET" or "POST". Defaults to "POST".
},
onError: {
(function) The callback function to call if at any time an
error occurred in the request. Defaults to a function that
alerts the user that an error has occurred.
},
onFailure: {
(function) The callback function for a request that has
failed. Defaults to an empty function.
},
onSuccess: {
(function) The callback function for a successful request.
Defaults to an empty function.
},
parameters: {
(object) An object containing any information to be sent to
the requested URL. Defaults to an empty object.
},
query_string: {
(string) If given, this will be used instead of the
"parameters" option. This should be a properly formed query
string to be sent to the server. Defaults to an empty
string.
}
)
Returns
(mixed) The AJAX transport. This can be eitehr XMLHttpRequest or ActiveXObject, depending on the browser.