Guest User

Untitled

a guest
Jul 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. // monitor wifi signal strength
  2. navigator.system.get("Network", function(connection) {
  3.  
  4. // helper that updates the dom
  5. function updateStatus(conn) {
  6. var msg = "Wireless "+conn.essid+" at "+(conn.signalStrength*100)+"%";
  7. x$('#network-status').html(msg);
  8. }
  9.  
  10. // only watch the wifi setting
  11. if (connection.type===connection.TYPE_IEEE802_11)
  12. navigator.system.watch("WifiConnection", updateStatus);
  13.  
  14. }, null);
Add Comment
Please, Sign In to add comment