Namespace CKFinder.ajax
Constructor Attributes | Constructor Name and Description |
---|---|
Ajax methods for data loading.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
CKFinder.ajax.load(url, callback, postParams)
Loads data from an URL as plain text.
|
<static> |
CKFinder.ajax.loadXml(url, callback, postParams)
Loads data from an URL as XML.
|
Method Detail
<static>
{String}
CKFinder.ajax.load(url, callback, postParams)
Since:
2.0
Loads data from an URL as plain text.
// Load data synchronously. var data = CKFinder.ajax.load( 'somedata.txt' ); alert( data );
// Load data asynchronously. var data = CKFinder.ajax.load( 'somedata.txt', function( data ) { alert( data ); } );
- Parameters:
- {String} url
- The URL from which load data.
- {Function} callback Optional
- A callback function to be called on data load. If not provided, the data will be loaded asynchronously, passing the data value the function on load.
- {String} postParams
- A urlencoded POST data.
- Returns:
- {String} The loaded data. For asynchronous requests, an empty string. For invalid requests, null.
<static>
{CKFinder.xml}
CKFinder.ajax.loadXml(url, callback, postParams)
Since:
2.0
Loads data from an URL as XML.
// Load XML synchronously. var xml = CKFinder.ajax.loadXml( 'somedata.xml' ); alert( xml.getInnerXml( '//' ) );
// Load XML asynchronously. var data = CKFinder.ajax.loadXml( 'somedata.xml', function( xml ) { alert( xml.getInnerXml( '//' ) ); } );
- Parameters:
- {String} url
- The URL from which load data.
- {Function} callback Optional
- A callback function to be called on data load. If not provided, the data will be loaded asynchronously, passing the data value the function on load.
- {String} postParams
- A urlencoded POST data.
- Returns:
- {CKFinder.xml} An XML object holding the loaded data. For asynchronous requests, an empty string. For invalid requests, null.