Check Active Internet Connection [duplicate]
Obviously this is a Javascript problem. As javascript are already loaded to the server, I was wondering if there is way to check whether there is active internet connection or not.
You could send an ajax request and see if it gets a response.
With jQuery:
$.ajax({
url: 'ajax/test.html',
success: function(data) {
alert('Connection.');
},
error: function(data) {
alert('No Connection.');
}
});
精彩评论