Embedding a script
<Script src="js/hippoapi.js"></script>
The script tag requires the src attribute to be assigned a Javascript file using the directory location “js/hippoapi.js” (This assumes that js/hippoapi.js is located in the same directory as the .html file). The embedded script class methods are available to be called in the HTML file.
For a list of Hippo Api class methods please go here
Binding class methods to an event
<div>
<button onclick="hippoAPI.playTimeline(1)">Timeline 1</button>
</div>
Using HTML event binding, a Hippo API class method can be passed as a string to an event handler, and invoked when an event is triggered. The example above uses the onclick event handler and assigns the Hippo API playTimeline() method to this event. Arguments for the method should be passed into the method call string within parentheses, playTimeline(args).
JSON data formatting
Data returned from a request will return a JSON formatted string (see the example below). JSON is a standardized data formatting standard with parsing support in all major programming languages.
{
"bankCount": 0,
"banks": [
{
"hasPresets": true,
"index": 0,
"name": "string",
"presets": [
{
"description": "string",
"fadeTime": 0,
"fadeType": "string",
"filters": "string",
"iD": "string",
"index": 0,
"name": "string",
"presetType": "string"
}
],
"thumbPreset": "string"
}
],
"presetType": "string"
}
Post your comment on this topic.