To use Samsung Product API, <script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script> Should be loaded in index.html
To use Samsung Product API,
<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>
Should be loaded in index.html
The module defines the functionalities that are provides as the Samsung TV for Tizen Platform Product API. Additionally, this API specifies the location in the ECMAScript hierarchy in which the Samsung TV for Tizen Platform Product API is instantiated (window.webapis).
Since : 2.3
Product : TV, AV, B2B
This interface defines the webapis interface as a part of the window global object.
[NoInterfaceObject] interface WebApiObject { readonly attribute WebApi webapis; };
Window implements WebApiObject;
This interface defines the root of Tizen Samsung Product API.
[NoInterfaceObject] interface WebApi { };
This interface defines Exception errors of APIs.
[NoInterfaceObject] interface WebAPIException { 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; readonly attribute unsigned long code; readonly attribute DOMString name; readonly attribute DOMString message; };
This interface will be used by the APIs in order to return them in the error callback of asynchronous methods.
[NoInterfaceObject] interface WebAPIError { readonly attribute unsigned long code; readonly attribute DOMString name; readonly attribute DOMString message; };
This interface is used in methods that do not require any return value in the success callback.
[Callback = FunctionOnly, NoInterfaceObject] interface SuccessCallback { void onsuccess(); };
Method invoked when the asynchronous call completes successfully.
void onsuccess();
Code Example :
function onsuccess() { console.log("Success Callback is called."); }
This interface is used in methods that require only an error as an input parameter in the error callback.
[Callback = FunctionOnly, NoInterfaceObject] interface ErrorCallback { void onerror(WebAPIError error); };
Method that is invoked when an error occurs.
void onerror(WebAPIError error);
Parameters :
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 { 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; readonly attribute unsigned long code; readonly attribute DOMString name; readonly attribute DOMString message; }; [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); }; };