|
previousPage Method
Description
This method retrieves the previous page of video search results for the current set of videos.
Arguments
This method does not accept any arguments.
Syntax
The following code sample illustrates how this method can be invoked:
TVS = new TruveoVideoSearch(appid);
...
TVS.previousPage();
Return Value
This method returns 'true' if the AJAX request was sent successfully.
Response Data Objects
The response returned by this method can update the following data objects:
|
method
|
A string containing the name of the API method used to retrieve the response. In this case, this field would return the string 'previousPage'.
Usage syntax: myVar = TVS.method;
|
|
query
|
A string containing the original submitted query associated with this response.
Usage syntax: myVar = TVS.query;
|
|
querySuggestion
|
A string containing a suggested query, if available, for the original submitted query associated with this response.
Usage syntax: myVar = TVS.querySuggestion;
|
|
VideoSet
|
The container for all of the video records in the set of returned videos.
More details on the structure and attributes of this data object can be found here.
Usage syntax: myVar = TVS.VideoSet;
|
|
TagSet
|
The container for all of the tags associated with the entire set of matching videos. The TagSet is returned only if the parameter 'showRelatedItems' is set to 1.
More details on the structure and attributes of this data object can be found here.
Usage syntax: myVar = TVS.TagSet;
|
|
ChannelSet
|
The container for all of the channels associated with the entire set of matching videos. The ChannelSet is returned only if the parameter 'showRelatedItems' is set to 1.
More details on the structure and attributes of this data object can be found here.
Usage syntax: myVar = TVS.ChannelSet;
|
|
CategorySet
|
The container for all of the categories associated with the entire set of matching videos. The CategorySet is returned only if the parameter 'showRelatedItems' is set to 1.
More details on the structure and attributes of this data object can be found here.
Usage syntax: myVar = TVS.CategorySet;
|
|
UserSet
|
The container for all of the users associated with the entire set of matching videos. The UserSet is returned only if the parameter 'showRelatedItems' is set to 1.
More details on the structure and attributes of this data object can be found here.
Usage syntax: myVar = TVS.UserSet;
|
Events
This method can fire the following events:
|
onupdate
|
This event fires when a response to an AJAX request
is received by the TruveoVideoSearch object. When this event fires, it will pass one argument, 'methodName', to any handler attached to this event. The value
of 'methodName' will be set to the name of the method that issued the original AJAX request associated with this onupdate event.
Event binding syntax: TVS.attachEvent('onupdate', 'myHandler(methodName);');
|
|
onerror
|
This event fires when an error occurs.
When this event fires, it will pass two arguments, 'errorCode' and 'errorMessage', to any handler attached to this event. The value
of 'errorCode' will be the numerical code assigned to the error and 'errorMessage' will be a text message that describes the error.
Event binding syntax: TVS.attachEvent('onerror', 'myHandler(errorCode, errorMessage);');
|
Errors
If execution of this method is not successful, the errors with the following error codes can be thrown:
|
1
|
Invalid request: 'appid'
An application ID was not submitted with the request.
|
|
2
|
Invalid request: 'method'
A method was not submitted with the request.
|
|
5
|
Invalid request: 'query'
The query parameter was not submitted with the request.
|
|
3
|
Invalid request: 'start'
The start parameter must be a non-negative integer.
|
|
4
|
Invalid request: 'results'
The results parameter must be an integer between 1 and 50.
|
|
7
|
Invalid request: 'showAdult'
The showAdult parameter must be 0 or 1.
|
|
21
|
Invalid request: 'showRelatedItems'
The showRelatedItems parameter must be 0 or 1.
|
|
8
|
Invalid request: 'tagresults'
The tagresults parameter must be an integer between 1 and 50.
|
|
9
|
Invalid request: 'channelresults'
The channelresults parameter must be an integer between 1 and 50.
|
|
10
|
Invalid request: 'categoryresults'
The categoryresults parameter must be an integer between 1 and 50.
|
|
11
|
Invalid request: 'userresults'
The userresults parameter must be an integer between 1 and 50.
|
|
12
|
Service Unavailable
Truveo Video Search API service unavailable.
|
|
13
|
Method not found.
The method you submitted with the request was not valid.
|
|
14
|
Access Denied: invalid appid.
The application ID submitted with the request is invalid.
|
|
15
|
Access Denied: appid over limit.
The application ID submitted with the request is over the daily request limit.
|
|
501
|
Error connecting to XMLHTTP AJAX service
The Truveo video search AJAX service could not be reached.
|
|