1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <meta charset="utf-8" />
5
    <title>Wialon Playground - Get sensors</title>
6
    <script type="text/javascript" src="//code.jquery.com/jquery-latest.min.js"></script>
7
    <script type="text/javascript" src="//hst-api.s-watcher.com/wsdk/script/wialon.js"></script>
8
</head>
9
<body>
10
11
Select unit: <select id="units"></select>
12
available sensors <select id="sensors"></select>
13
<div id="log"></div>
14
15
</body>
16
</html>
HTML
2
 
1
#log { border: 1px solid #c6c6c6; }
2
.icon {float:left; margin:10px;}
CSS
90
 
1
$(document).ready(function () {
2
    
3
    wialon.core.Session.getInstance().initSession("https://hst-api.s-watcher.com"); // init session
4
    // For more info about how to generate token check
5
    // http://sdk.s-watcher.com/playground/demo/app_auth_token
6
    wialon.core.Session.getInstance().loginToken("0f481b03d94e32db858c7bf2d8415204289C57FB5B35C22FC84E9F4ED84D5063558E1178", "", // try to login
7
        function (code) { // login callback
8
            if (code) { return; } // exit if error code
9
            init(); // when login suceed then run init() function
10
        });
11
});
12
13
function init()  {
14
  console.log('init start');
15
   // Get the Sidebar
16
17
  getMainInfo()
JS
Result
Source code of example Close ✕
1
 
1
/*source*/