Created
February 20, 2019 14:41
-
-
Save onurcan19772/0a46ec9d35becb4745f189217c203881 to your computer and use it in GitHub Desktop.
Javascript Ping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="tr"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="pragma" content="no-cache" /> | |
<title>Test sayfası</title> | |
<style type="text/css"> | |
ul span { | |
color: green; | |
} | |
</style> | |
</head> | |
<body> | |
<script src="/Scripts/ping/ping.min.js?ver=1.04" language="Javascript" type="text/javascript"></script> | |
<ul> | |
<li>rock55.duckdns.org <span id="ping-google"></span></li> | |
</ul> | |
<script src="https://gist.github.com/alfg/c44d8b061972879c9121.js?ver=1.04" language="Javascript" type="text/javascript"></script> | |
<script language="Javascript" type="text/javascript"> | |
var settings = { | |
timeout: 60000, // Optional. | |
logError: true // Optional. | |
} | |
var p = new Ping(settings); | |
p.ping("http://rock55.duckdns.org", function(err, data) { | |
// Also display error if err is returned. | |
if (err) { | |
console.log("error loading resource") | |
data = data + " " + err; | |
} | |
document.getElementById("ping-google").innerHTML = data; | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment