Class TVB.Connection
TVBLOB custom event class
Methods
void
request
(
oMethod
,
oUrl
,
oParams
,
oTimeout
)
Start a new XHR async connection
- Parameters:
-
oMethod
<String>
"POST" or "GET"
-
oUrl
<String>
URI to be called
-
oParams
<Object>
JSON object to be passed to the POST call
-
oTimeout
<Number>
Milliseconds for the timeout (default 8000ms)
- Returns:
void
String
syncRequest
(
method
,
uri
,
params
)
Perform a sync request and returns the content
- Parameters:
-
method
<Object>
'POST' or 'GET'
-
uri
<Object>
-
params
<Object>
- Returns:
String
- The message returned, false if connection failed
Object
xmlhttp
(
)
Create a new http asyncronous request
- Returns:
Object
- xmlHttp object
Events
TVB.Connection.events.failureevent
(
)
Fires when a failure happens
TVB.Connection.events.loadingstart
(
)
Fires when the loading starts
TVB.Connection.events.loadingstop
(
)
Fires when the loading stops
TVB.Connection.events.timeoutevent
(
)
Fires when a timeout happens
Configuration Attributes
Set this property to the callback to be called after a successfull XHR connection