Skip to content

Instantly share code, notes, and snippets.

@stephenway
Created June 16, 2015 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephenway/b300d12f5e6c03bbafd2 to your computer and use it in GitHub Desktop.
Save stephenway/b300d12f5e6c03bbafd2 to your computer and use it in GitHub Desktop.
vOJzrP
<script>
$.ajax({
url: "http://dig.jsondns.org/IN/" + window.location.hostname + "/A?callback=jsonp",
type: "GET",
dataType: "jsonp",
success: function(response) {
var showWarning = false;
$.each(response.answer, function(index, value) {
if (value.type === "A" && value.rdata === "63.135.210.217") {
showWarning = true;
}
});
if (showWarning) {
$("body").append('<div id="dnsWarning" style="z-index: 1000; position: fixed; top: 0; left: 0; width:100%; height: 100%; background-color: white; -moz-opacity: 0.9; opacity: 0.9; filter: alpha(opacity=90); filter: progid:DXImageTransform.Microsoft.Alpha(opacity=90);"><div style="margin: 0 auto; width: 50%; position: relative; top:50%; transform: translateY(-50%);"><h1>Attention Insurance Agency: Agency Revolution Needs You To Update Your DNS Settings ASAP</h1><button style="background-color: red; color: white; font-size: 20px" onClick="readMoreDns();">Read More</button><br>This message will self-destruct automatically 24 hours after the changes are made. <a href="javascript:closeDns()">Close</a><br>Your customers won\'t see this message.<br>If you do nothing this website will be down on April 1st.</div></div>');
}
}
});
function closeDns() {
$("#dnsWarning").hide();
}
function readMoreDns() {
window.location.href="https://now.agencyrevolution.com/blog/attention-required-for-dio-clients-new-ip-address";
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment