-
▼.hLoadData (Mode1 Property)
-
The ".hLoadData" property can be used to send key/value pairs to the server.
-
When set as a string, the request is made as a "GET";
When set as an object{}, the request is made as a "POST".
Syntax
$A([
{
hLoadData: {
firstName: 'Bryan',
lastName: 'Garaventa'
},
...
}
]);
// Or
$A.reg.myObj.hLoadData = {
firstName: 'Bryan',
lastName: 'Garaventa'
};
Required:
-
The "mode" property must be set to 1;
-
The "source" property must include a valid resource path.
-
▼.hLoad() (Mode1 Handler)
-
The "hLoad()" callback is immediately processed after the get/post request.
-
Syntax
$A([
{
hLoad: function(responseText, textStatus, XMLHttpRequest, dc){
// Do something
},
...
}
]);
// Or
$A.reg.myObj.hLoad = function(responseText, textStatus, XMLHttpRequest, dc){
// Do something
};
Required:
-
The "mode" property must be set to 1;
-
The "source" property must include a valid resource path.
-
▼.content (Mode2-6 Property)
-
The ".content" property specifies the content to be rendered.
-
Syntax
$A([
{
hSuccess: function(options, data, textStatus, XMLHttpRequest, dc){
dc.content = data;
},
...
}
]);
Important
-
When the "mode" property is set to either 0 or 1, the "source" property must be used to assign content or to provide a resource path.
Required:
-
The "mode" property must be set to either 2 through 6;
-
Depending on the value of the "mode" property, either the "source" or "ajaxOptions.url" property must include a valid resource path.
-
▼.hGetData (Mode2 Property)
-
The "hGetData" property can be used to send key/value pairs to the server during a get request.
-
Syntax
$A([
{
hGetData: serialize(form),
...
}
]);
// Or
$A.reg.myObj.hGetData = serialize(form);
Required:
-
The "mode" property must be set to 2;
-
The "source" property must include a valid resource path.
-
▼.hGetType (Mode2 Property)
-
The "hGetType" property identifies the return Data Type of the get request.
-
Supported values:
-
"xml"
-
"html"
-
"script"
-
"json"
-
"jsonp"
-
"text"
Syntax
$A([
{
hGetType: 'html',
...
}
]);
// Or
$A.reg.myObj.hGetType = 'xml';
Required:
-
The "mode" property must be set to 2;
-
The "source" property must include a valid resource path.
-
▼.hGet() (Mode2 Handler)
-
The "hGet()" callback is immediately processed after the get request.
-
Syntax
$A([
{
hGet: function(data, textStatus, dc){
// Do something
},
...
}
]);
// Or
$A.reg.myObj.hGet = function(data, textStatus, dc){
// Do something
};
Required:
-
The "mode" property must be set to 2;
-
The "source" property must include a valid resource path;
-
The ".content" property must be set for the new content to be rendered.
-
▼.hJSONData (Mode3 Property)
-
The "hJSONData" property can be used to send key/value pairs to the server during a get request.
-
Syntax
$A([
{
hJSONData: {
firstName: 'Bryan',
lastName: 'Garaventa'
},
...
}
]);
// Or
$A.reg.myObj.hJSONData = {
firstName: 'Bryan',
lastName: 'Garaventa'
};
Required:
-
The "mode" property must be set to 3;
-
The "source" property must include a valid resource path.
-
▼.hJSON() (Mode3 Handler)
-
The "hJSON()" callback is immediately processed after the get request.
-
Syntax
$A([
{
hJSON: function(data, textStatus, dc){
// Do something
},
...
}
]);
// Or
$A.reg.myObj.hJSON = function(data, textStatus, dc){
// Do something
};
Required:
-
The "mode" property must be set to 3;
-
The "source" property must include a valid resource path;
-
The ".content" property must be set for the new content to be rendered.
-
▼.hScript() (Mode4 Handler)
-
The "hScript()" callback is immediately processed after the get request.
-
Syntax
$A([
{
hScript: function(data, textStatus, dc){
// Do something
},
...
}
]);
// Or
$A.reg.myObj.hScript = function(data, textStatus, dc){
// Do something
};
Required:
-
The "mode" property must be set to 4;
-
The "source" property must include a valid resource path to an external JS file;
-
The ".content" property must be set for the new content to be rendered.
-
▼.hPostData (Mode5 Property)
-
The "hPostData" property can be used to send key/value pairs to the server during a post request.
-
Syntax
$A([
{
hPostData: {
firstName: 'Bryan',
lastName: 'Garaventa'
},
...
}
]);
// Or
$A.reg.myObj.hPostData = {
firstName: 'Bryan',
lastName: 'Garaventa'
};
Required:
-
The "mode" property must be set to 5;
-
The "source" property must include a valid resource path.
-
▼.hPostType (Mode5 Property)
-
The "hPostType" property identifies the return Data Type of the post request.
-
Supported values:
-
"xml"
-
"html"
-
"script"
-
"json"
-
"jsonp"
-
"text"
Syntax
$A([
{
hPostType: 'text',
...
}
]);
// Or
$A.reg.myObj.hPostType = 'xml';
Required:
-
The "mode" property must be set to 5;
-
The "source" property must include a valid resource path.
-
▼.hPost() (Mode5 Handler)
-
The "hPost()" callback is immediately processed after the post request.
-
Syntax
$A([
{
hPost: function(data, textStatus, dc){
// Do something
},
...
}
]);
// Or
$A.reg.myObj.hPost = function(data, textStatus, dc){
// Do something
};
Required:
-
The "mode" property must be set to 5;
-
The "source" property must include a valid resource path;
-
The ".content" property must be set for the new content to be rendered.
-
▼.ajaxOptions (Mode6 Property)
-
The "ajaxOptions" property can be used to configure an AJAX request.
-
All available options are designed to mirror the
jQuery AJAX Options
for convenience.
Syntax
$A([
{
ajaxOptions: {
url: 'query/playlist.php'
},
...
}
]);
// Or
$A.reg.myObj.ajaxOptions.url = 'load/myPlayer.php';
Important
-
The "source" property is ignored when processing an AJAX request.
Required:
-
The "mode" property must be set to 6;
-
The "ajaxOptions.url" property must include a valid resource path.
-
▼.hBeforeSend() (Mode6 Handler)
-
The "hBeforeSend()" callback is immediately executed before the AJAX request is initiated.
-
Syntax
$A([
{
hBeforeSend: function(options, XMLHttpRequest, dc){
// Do something
},
...
}
]);
// Or
$A.reg.myObj.hBeforeSend = function(options, XMLHttpRequest, dc){
// Do something
};
Required:
-
The "mode" property must be set to 6;
-
The "ajaxOptions.url" property must include a valid resource path;
-
▼.hSuccess() (Mode6 Handler)
-
The "hSuccess()" callback is immediately executed after the AJAX request is processed.
-
Syntax
$A([
{
hSuccess: function(options, data, textStatus, XMLHttpRequest, dc){
// Do something
},
...
}
]);
// Or
$A.reg.myObj.hSuccess = function(options, data, textStatus, XMLHttpRequest, dc){
// Do something
};
Required:
-
The "mode" property must be set to 6;
-
The "ajaxOptions.url" property must include a valid resource path;
-
The ".content" property must be set for the new content to be rendered.
-
▼.hComplete() (Mode6 Handler)
-
The "hComplete()" callback is immediately executed after the AJAX request has completed.
-
Syntax
$A([
{
hComplete: function(options, XMLHttpRequest, textStatus, dc){
// Do something
},
...
}
]);
// Or
$A.reg.myObj.hComplete = function(options, XMLHttpRequest, textStatus, dc){
// Do something
};
Required:
-
The "mode" property must be set to 6;
-
The "ajaxOptions.url" property must include a valid resource path;
-
▼.hError() (Mode6 Handler)
-
The "hError()" callback is executed when an error is thrown during an AJAX request.
-
Syntax
$A([
{
hError: function(options, XMLHttpRequest, textStatus, errorThrown, dc){
// Do something
},
...
}
]);
// Or
$A.reg.myObj.hError = function(options, XMLHttpRequest, textStatus, errorThrown, dc){
// Do something
};
Required:
-
The "mode" property must be set to 6;
-
The "ajaxOptions.url" property must include a valid resource path.
-
▼.request (Mode2-6 Property)
-
The ".request" property contains the last XMLHttpRequest object returned by an AJAX request.
-
Syntax
$A([
{
runAfter: function(dc){
var XMLHTTPRequest = dc.request;
},
...
}
]);
// Or
var XMLHTTPRequest = $A.reg.myObj.request;
Required:
-
The "mode" property must be set to either 2 through 6;
-
Depending on the value of the "mode" property, either the "source" or "ajaxOptions.url" property must include a valid resource path.
-
▼$A.load()
-
"$A.load()" is a shorthand method for pulling content from an external resource and injecting it into a container element.
-
Syntax
$A.load( ( 'div.container' || document.getElementById('myContainer') ), 'files/core/s4.htm', {}, function(responseText, textStatus, XMLHttpRequest){
// Do something
});
-
▼$A.get()
-
"$A.get()" is a shorthand method for pulling content from an external resource and executing a callback.
-
Syntax
$A.get('files/demo/insert.php', ( '' || {} ), function(data, textStatus){
// Do something
}, ( 'GET' || 'POST' ) );
-
▼$A.getJSON()
-
"$A.getJSON()" is a shorthand method for pulling JSON data from an external resource and executing a callback.
-
Syntax
$A.getJSON('http://whatsock.com/json_resource', {}, function(data, textStatus){
// Do something
});
-
▼$A.getScript()
-
"$A.getScript()" is a shorthand method for pulling external JavaScript into the DOM and executing it.
-
Syntax
$A.getScript( ('js/helpers.js' || 'http://whatsock.com/js/helpers.js' ), function(data, textStatus){
// Do something
}, (disableAsync = true or false) );
// Or
$A.getScript('FilePath.js');
-
▼$A.post()
-
"$A.post()" is a shorthand method for posting data to a server and returning a callback.
-
Syntax
$A.post('http://whatsock.com/post_data.php', 'name=Rincewind&occupation=WIZZARD', function(data, textStatus){
// Do something
}, ( 'GET' || 'POST' ) );
-
▼$A.ajax()
-
"$A.ajax()" is a shorthand method for executing an AJAX request and returning a callback.
-
Syntax
$A.ajax( {ajax_options} );