To use Samsung Product API,
<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>
Should be loaded in index.html
Since : 2.4
Product : SSSP
Interface | Method |
---|---|
WebApiObject | |
WebApi | |
WebAPIException | |
WebAPIError | |
SuccessCallback | void onsuccess () |
ErrorCallback | void onerror (WebAPIError error) |
[NoInterfaceObject]interface WebApiObject {
readonly attribute WebApi webapis;
};
Window implements WebApiObject;
[NoInterfaceObject]interface WebApi {};
[NoInterfaceObject]interface WebAPIException {
readonly attribute unsigned long code;
readonly attribute DOMString name;
readonly attribute DOMString message;
const unsigned long INDEX_SIZE_ERR = 1;
const unsigned long DOMSTRING_SIZE_ERR = 2;
const unsigned long HIERARCHY_REQUEST_ERR = 3;
const unsigned long WRONG_DOCUMENT_ERR = 4;
const unsigned long INVALID_CHARACTER_ERR = 5;
const unsigned long NO_DATA_ALLOWED_ERR = 6;
const unsigned long NO_MODIFICATION_ALLOWED_ERR = 7;
const unsigned long NOT_FOUND_ERR = 8;
const unsigned long NOT_SUPPORTED_ERR = 9;
const unsigned long INUSE_ATTRIBUTE_ERR = 10;
const unsigned long INVALID_STATE_ERR = 11;
const unsigned long SYNTAX_ERR = 12;
const unsigned long INVALID_MODIFICATION_ERR = 13;
const unsigned long NAMESPACE_ERR = 14;
const unsigned long INVALID_ACCESS_ERR = 15;
const unsigned long VALIDATION_ERR = 16;
const unsigned long TYPE_MISMATCH_ERR = 17;
const unsigned long SECURITY_ERR = 18;
const unsigned long NETWORK_ERR = 19;
const unsigned long ABORT_ERR = 20;
const unsigned long URL_MISMATCH_ERR = 21;
const unsigned long QUOTA_EXCEEDED_ERR = 22;
const unsigned long TIMEOUT_ERR = 23;
const unsigned long INVALID_NODE_TYPE_ERR = 24;
const unsigned long DATA_CLONE_ERR = 25;
const unsigned long INVALID_VALUES_ERR = 26;
const unsigned long IO_ERR = 27;
const unsigned long SERVICE_NOT_AVAILABLE_ERR = 28;
const unsigned long UNKNOWN_ERR = 9999;
};
[NoInterfaceObject]interface WebAPIError {
readonly attribute unsigned long code;
readonly attribute DOMString name;
readonly attribute DOMString message;
};
[Callback = FunctionOnly, NoInterfaceObject]interface SuccessCallback {
void onsuccess();
};
onsuccess
void onsuccess();
Since : 2.3
Product : TV, AV_BD
Code example:
function onsuccess()
{
console.log("Success Callback is called.");
}
[Callback = FunctionOnly, NoInterfaceObject]interface ErrorCallback {
void onerror(WebAPIError error);
};
onerror
void onerror(WebAPIError error);
Since : 2.3
Product : TV, AV_BD
Parameters:
Code example:
function onerror(error)
{
console.log(error.message);
}
module WebApi {
[NoInterfaceObject]interface WebApiObject {
readonly attribute WebApi webapis;
};
Window implements WebApiObject;
[NoInterfaceObject]interface WebApi {};
[NoInterfaceObject]interface WebAPIException {
readonly attribute unsigned long code;
readonly attribute DOMString name;
readonly attribute DOMString message;
const unsigned long INDEX_SIZE_ERR = 1;
const unsigned long DOMSTRING_SIZE_ERR = 2;
const unsigned long HIERARCHY_REQUEST_ERR = 3;
const unsigned long WRONG_DOCUMENT_ERR = 4;
const unsigned long INVALID_CHARACTER_ERR = 5;
const unsigned long NO_DATA_ALLOWED_ERR = 6;
const unsigned long NO_MODIFICATION_ALLOWED_ERR = 7;
const unsigned long NOT_FOUND_ERR = 8;
const unsigned long NOT_SUPPORTED_ERR = 9;
const unsigned long INUSE_ATTRIBUTE_ERR = 10;
const unsigned long INVALID_STATE_ERR = 11;
const unsigned long SYNTAX_ERR = 12;
const unsigned long INVALID_MODIFICATION_ERR = 13;
const unsigned long NAMESPACE_ERR = 14;
const unsigned long INVALID_ACCESS_ERR = 15;
const unsigned long VALIDATION_ERR = 16;
const unsigned long TYPE_MISMATCH_ERR = 17;
const unsigned long SECURITY_ERR = 18;
const unsigned long NETWORK_ERR = 19;
const unsigned long ABORT_ERR = 20;
const unsigned long URL_MISMATCH_ERR = 21;
const unsigned long QUOTA_EXCEEDED_ERR = 22;
const unsigned long TIMEOUT_ERR = 23;
const unsigned long INVALID_NODE_TYPE_ERR = 24;
const unsigned long DATA_CLONE_ERR = 25;
const unsigned long INVALID_VALUES_ERR = 26;
const unsigned long IO_ERR = 27;
const unsigned long SERVICE_NOT_AVAILABLE_ERR = 28;
const unsigned long UNKNOWN_ERR = 9999;
};
[NoInterfaceObject]interface WebAPIError {
readonly attribute unsigned long code;
readonly attribute DOMString name;
readonly attribute DOMString message;
};
[Callback = FunctionOnly, NoInterfaceObject]interface SuccessCallback {
void onsuccess();
};
[Callback = FunctionOnly, NoInterfaceObject]interface ErrorCallback {
void onerror(WebAPIError error);
};
};