Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Arvin iuunhao
Added: Jun 18, 2018 9:20 AM
Views: 18
Tags: js
检测网络
  1. window.addEventListener('online', function(e){console.log('online')});
  2. window.addEventListener('offline', function(e){console.log('offline');});