Class SS.net.requestor
Data Request object
Defined in: SS.net.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
SS.net.requestor(url, param, onload, onerror, ontimeout, timeout, loadId, loadImageId, title, type)
|
| Field Attributes | Field Name and Description |
|---|---|
|
Request data asynchronously.
|
|
|
Identifier for this requestor object.
|
|
|
Identifier for this requestor object.
|
|
|
Function called if the request of the specified resource resulted in an error, including timeout.
|
|
|
Function called upon the successful completion of the request for the specified resource.
|
|
|
Function called if the request of the specified resource resulted in a timeout.
|
|
|
Parameter object which is serialized and posted to the defined URL using the POST method.
|
|
|
Number of seconds the request has to complete within before being cancelled and the ontimeout event is raised.
|
|
|
Free text description of the request.
|
|
|
Define Microsoft XML ActiveX Object type to use instead of defaults.
|
| Method Attributes | Method Name and Description |
|---|---|
|
execute()
Execute Request.
|
|
|
Checks to see if the request has timed out.
|
|
|
p2s(p, f)
Takes a parameter object and recursively converts it into a string so that it can be
posted to the specified destiantion.
|
|
|
reinit(url, param, onload, onerror, ontimeout, timeout, loadId, loadImageId, title, type)
Re-Initialize.
|
|
|
Handles the state changes of the requestor object.
|
|
|
timedOut()
Handles the timeout event internally before calling registered SS.net.requestor.ontimeout and SS.net.requestor.onerror functions.
|
Class Detail
SS.net.requestor(url, param, onload, onerror, ontimeout, timeout, loadId, loadImageId, title, type)
- Parameters:
- url
- param
- onload
- onerror
- ontimeout
- timeout
- loadId
- loadImageId
- title
- type
Field Detail
<private>
_tId
Request Timer Id
async
Request data asynchronously. When true, JavaScript script will continue to execute whilst the
request for the resource is being carried out. If false then script execution is paused until the
request has completed or resulted in an error. Default = true.
id
Identifier for this requestor object.
loadimageid
Identifier for this requestor object.
onerror
Function called if the request of the specified resource resulted in an error, including timeout.
onload
Function called upon the successful completion of the request for the specified resource.
ontimeout
Function called if the request of the specified resource resulted in a timeout.
param
Parameter object which is serialized and posted to the defined URL using the POST method.
timeout
Number of seconds the request has to complete within before being cancelled and the ontimeout event is raised.
title
Free text description of the request.
type
Define Microsoft XML ActiveX Object type to use instead of defaults. Default = null.
Generally this property should always be null.
Method Detail
execute()
Execute Request. Executes the request for retrieve the specified resource.
- Returns:
- null
{Boolean}
hasTimedOut()
Checks to see if the request has timed out.
- Returns:
- {Boolean} Timed out = true, else false.
{String}
p2s(p, f)
Takes a parameter object and recursively converts it into a string so that it can be
posted to the specified destiantion.
E.g. data.txtInput = 123
data.txtInput2 = 345
returns txtInput=123&txtInput2=354
- Parameters:
- {Object} p
- Parameter object to be converted into a {String}.
- {String} f
- (Optional) Prefix. Used for recursive calls.
- Returns:
- {String} Converted input object as string.
reinit(url, param, onload, onerror, ontimeout, timeout, loadId, loadImageId, title, type)
Re-Initialize. Resets this requestor object to its original state then applies the new parameters to make it ready for reuse
- Parameters:
- {String} url
- Location of the document to load.
- {Object} param
- Parameters to send to the url using POST method, else leave blank. e.g. {param1:"1",param2:"2" ...}.
- {Function} onload
- Function to call after the document has loaded successfully
- {Function} onerror
- Function to call if there was an error processing the request for the document
- {Function} ontimeout
- Function to call if the request timed out
- {Integer} timeout
- Number of seconds the request must be completed in before raising a timeout error
- {String} loadId
- Id assigned to the request object used for fetching the data
- {String} loadImageId
- Id of an element, typically an image, which is made visible / hidden during the fetching of data
- {String} title
- Data Loader Title Description. Optional use to hold a free text description of what the data loader is doing.
- type
- Returns:
- null
stateChanged()
Handles the state changes of the requestor object.
- Returns:
- null
timedOut()
Handles the timeout event internally before calling registered SS.net.requestor.ontimeout and SS.net.requestor.onerror functions.
- Returns:
- null
