51 lines
1.8 KiB
HTML
51 lines
1.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
</head>
|
|
<body>
|
|
<label for="inputText">Enter Domain Name: </label>
|
|
<input type="text" id="inputText">
|
|
<button onclick="sendGetRequest()">Send</button>
|
|
|
|
<h3>Results: </h3>
|
|
<h5>a:</h5>
|
|
<pre id="result1"></pre>
|
|
<h5>mx: </h5>
|
|
<pre id="result2"></pre>
|
|
<h5>spf: </h5>
|
|
<pre id="result3"></pre>
|
|
|
|
<script>
|
|
async function sendGetRequest() {
|
|
const inputText = document.getElementById('inputText').value;
|
|
|
|
try {
|
|
const response1 = await fetch(`/a?domain=${encodeURIComponent(inputText)}`);
|
|
const result1 = await response1.json();
|
|
document.getElementById('result1').textContent = JSON.stringify(result1, undefined, 4);
|
|
|
|
const response2 = await fetch(`/mx?domain=${encodeURIComponent(inputText)}`);
|
|
const result2 = await response2.json();
|
|
document.getElementById('result2').textContent = JSON.stringify(result2, undefined, 4);
|
|
|
|
const response3 = await fetch(`/spf?domain=${encodeURIComponent(inputText)}`);
|
|
const result3 = await response3.json();
|
|
document.getElementById('result3').textContent = JSON.stringify(result3, undefined, 4);
|
|
} catch (error) {
|
|
console.error('ERROR:', error);
|
|
}
|
|
}
|
|
|
|
// Add event listener for Enter key press
|
|
document.getElementById("inputText").addEventListener("keyup", function(event) {
|
|
if (event.key === "Enter") {
|
|
event.preventDefault();
|
|
sendGetRequest();
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|