-
Notifications
You must be signed in to change notification settings - Fork 0
/
jscript.h
33 lines (33 loc) · 1.24 KB
/
jscript.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const String javascript PROGMEM = " $(document).ready(function(){\r\n"
" setInterval(getData,1000);\r\n"
" function getData(){\r\n"
" $.ajax({\r\n"
" type:\"GET\",\r\n"
" url:\"data\",\r\n"
" success: function(data){\r\n"
" var s = data.split(\'-\');\r\n"
" var t = parseInt(s);\r\n"
" switch(t){ \r\n"
" case 1:"
" $('#turbidity').css('background-color','white');\r\n"
" break; \r\n"
" case 2:"
" $('#turbidity').css('background-color','#EEE1DF');\r\n"
" break; \r\n"
" case 3:"
" $('#turbidity').css('background-color','D5BDB8');\r\n"
" break; \r\n"
" case 4:"
" $('#turbidity').css('background-color','#886058');\r\n"
" break; \r\n"
" case 5:"
" $('#turbidity').css('background-color','#4D2820');\r\n"
" break; \r\n"
" } "
" $('#tur-value').val(s[0]);\r\n"
"}\r\n"
"}).done(function() {\r\n"
" console.log('ok');\r\n"
"})\r\n"
"}\r\n"
"});";