Conditions | 4 |
Paths | 4 |
Total Lines | 34 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | var socket = io.connect(); |
||
11 | socket.on('log', function(data) { |
||
12 | if (data.streamId === streamId) { |
||
13 | if (data.format === 'json') { |
||
14 | var p = document.createElement('p'); |
||
15 | |||
16 | var d = document.createElement('div'); |
||
17 | d.className = 'tags'; |
||
18 | |||
19 | var s1 = document.createElement('span'); |
||
20 | s1.className = 'date'; |
||
21 | s1.innerHTML = (new Date()).toLocaleDateString( |
||
22 | 'en-GB', |
||
23 | {hour: '2-digit', minute: '2-digit', second: '2-digit'} |
||
24 | ); |
||
25 | d.appendChild(s1); |
||
26 | |||
27 | var s2 = document.createElement('span'); |
||
28 | s2.className = 'ip'; |
||
29 | s2.innerHTML = data.ip; |
||
30 | d.appendChild(s2); |
||
31 | |||
32 | var c = document.createElement('code'); |
||
33 | c.className = 'blink'; |
||
34 | c.innerHTML = JSON.stringify(data.data); |
||
35 | |||
36 | p.appendChild(d); |
||
37 | p.appendChild(c); |
||
38 | document.getElementById('root').appendChild(p); |
||
39 | if (autoScrool === true) { |
||
40 | window.scrollTo(0, document.body.scrollHeight); |
||
41 | } |
||
42 | } |
||
43 | } |
||
44 | }); |
||
45 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.