website/themes/hugo-theme-wave/static/js/main.js
2020-02-09 11:50:54 +01:00

32 lines
552 B
JavaScript

// dip service
function main() {
var jqxhr =
$.ajax({
type: "GET",
url: "https://ip.paulbsd.com",
headers: {
'Access-Control-Allow-Origin': '*',
'Accept': 'application/json',
},
dataType: 'json',
}).done(function(data) {
var dip = $('#dip');
dip[0].text = data.ip;
});
return jqxhr;
}
function transformIPInfo(data) {
if (data.hostname != '') {
return data.ip + '/' + data.hostname;
}
else {
return data.ip;
}
}
$(document).ready(function() {
main();
});