(no, yes)
| 4 | const wifiIcon = card.querySelector('.icon'); |
| 5 | |
| 6 | function isOnline(no, yes) { |
| 7 | var xhr = XMLHttpRequest |
| 8 | ? new XMLHttpRequest() |
| 9 | : new ActiveXObject('Microsoft.XMLHttp'); |
| 10 | xhr.onload = function () { |
| 11 | if (yes instanceof Function) { |
| 12 | yes(); |
| 13 | } |
| 14 | }; |
| 15 | xhr.onerror = function () { |
| 16 | if (no instanceof Function) { |
| 17 | no(); |
| 18 | } |
| 19 | }; |
| 20 | xhr.open('GET', 'https://jsonplaceholder.typicode.com/posts.php', true); |
| 21 | xhr.send(); |
| 22 | } |
| 23 | |
| 24 | isOnline( |
| 25 | function () { |
no test coverage detected