Go to the source code of this file.
Initial value:=
function(
url, options) {
options =
elgg.ajax.handleOptions(
url, options);
options.url =
elgg.normalize_url(options.url);
return $.ajax(options);
}
if(!$site) if(!($site instanceof ElggSite)) $site url
Wrapper function for jQuery.ajax which ensures that the url being called is relative to the elgg site root.
- Author
- Evan Winslow Provides a bunch of useful shortcut functions for making ajax calls
You would most likely use elgg.get or elgg.post, rather than this function
- Parameters
-
{string} | url Optionally specify the url as the first argument |
{Object} | options Optional. jQuery#ajax |
- Returns
- {jqXHR}
Definition at line 19 of file ajax.js.
Initial value:= function (method, options) {
elgg.assertTypeOf(
'string', method);
var defaults = {
dataType: 'json',
data: {}
};
options =
elgg.ajax.handleOptions(method, options);
options = $.extend(defaults, options);
options.url = 'services/api/rest/' + options.dataType + '/';
options.data.method = method;
return elgg.ajax(options);
}
Definition at line 246 of file ajax.js.
Initial value:=
function(
url, options) {
options =
elgg.ajax.handleOptions(
url, options);
options.type = 'get';
return elgg.ajax(options);
}
if(!$site) if(!($site instanceof ElggSite)) $site url
Wrapper function for elgg.ajax which forces the request type to 'get.
'
- Parameters
-
{string} | url Optionally specify the url as the first argument |
{Object} | options jQuery#ajax |
- Returns
- {jqXHR}
Definition at line 115 of file ajax.js.
Initial value:=
function(
url, options) {
options =
elgg.ajax.handleOptions(
url, options);
options.dataType = 'json';
return elgg.get(options);
}
if(!$site) if(!($site instanceof ElggSite)) $site url
Wrapper function for elgg.get which forces the dataType to 'json.
'
- Parameters
-
{string} | url Optionally specify the url as the first argument |
{Object} | options jQuery#ajax |
- Returns
- {jqXHR}
Definition at line 129 of file ajax.js.
Initial value:=
function(
url, options) {
options =
elgg.ajax.handleOptions(
url, options);
options.type = 'post';
return elgg.ajax(options);
}
if(!$site) if(!($site instanceof ElggSite)) $site url
Wrapper function for elgg.ajax which forces the request type to 'post.
'
- Parameters
-
{string} | url Optionally specify the url as the first argument |
{Object} | options jQuery#ajax |
- Returns
- {jqXHR}
Definition at line 143 of file ajax.js.