Update 'public/js/admin_domains.js'

This commit is contained in:
mia 2019-02-23 05:43:10 +01:00
parent 563c48d0da
commit bf25528424
1 changed files with 15 additions and 14 deletions

View File

@ -1,14 +1,15 @@
function updateOwnerEmail() { function showOwnerEmail(in_name) {
var name = this.domainName; let name = in_name;
document.getElementById("owneremail-"+name).innerHTML = this.responseText; if (!document.getElementById('owneremail-' + name)) {
return;
} }
document.getElementById('owneremail-' + name).innerHTML = 'Loading...';
function showOwnerEmail(name) { fetch('/api/get_owner_email?name=' + encodeURIComponent(name), {
document.getElementById("owneremail-"+name).innerHTML = "Loading..."; method: 'GET',
mode: 'cors'
var req = new XMLHttpRequest(); }).then(g => g.text()).then(g => {
req.domainName = name; document.getElementById('owneremail-' + name).innerHTML = g;
req.addEventListener("load", updateOwnerEmail); }).catch((e) => {
req.open("GET", "/api/get_owner_email?name="+encodeURIComponent(name)); console.log('server error', e);
req.send(); });
} }