This is more like a general js issue, rather than F7, but I use this method. You can translate it into F7 easily.
function checkCon()
{
$.ajax({
url: "/anysite.html",
cache: false,
type: "GET",
crossDomain : true,
success: function(response) {
document.getElementById("logStatus").innerHTML= "";
},
error: function(xhr) {
document.getElementById("logStatus").innerHTML = "<span style='color:red' class='warning'>No connection. <a href='login.html'>Refresh</a> page.</span>";
}
});
}
jQuery(document).ready(function($){
checkCon();
});