1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <meta charset="utf-8" />
5
    <title>Wialon Playground - Get units</title>
6
    <script type="text/javascript" src="//code.jquery.com/jquery-latest.min.js"></script>
7
    <script type="text/javascript" src="//hst-api.wialon.com/wsdk/script/wialon.js"></script>
8
</head>
9
<body>
10
11
<pre id="log"></pre>
12
13
</body>
14
</html>
HTML
2
 
1
#log { border: 1px solid #c6c6c6; }
2
.icon {float:left; margin:10px;}
CSS
46
 
1
// Print message to log
2
function msg(text) { $("#log").prepend(text + "<br/>"); }
3
4
function init() { // Execute after login succeed
5
    var s = wialon.core.Session.getInstance(); // get instance of current Session
6
    var r = wialon.core.Remote.getInstance();
7
    
8
    var UNIT_ID = 734477;
9
    
10
    r.remoteCall('messages/load_last', {
11
        itemId: UNIT_ID,
12
        lastTime: s.getServerTime(),
13
        lastCount: 1,
14
        flags: 0,
15
        flagsMask: 0,
16
        loadCount: 1
17
    }, function(error) {
JS
Result
Source code of example Close ✕
1
 
1
/*source*/