Revela-Frontend/public/importhost.js
2024-02-29 13:51:12 -05:00

14 lines
423 B
JavaScript

// Specify the URL of the PHP file
const phpFileUrl = './gethost.php';
// Fetch the content of the PHP file
fetch(phpFileUrl)
.then(response => response.text())
.then(content => {
// Update the content of the .node-id element
const nodeIdElement = document.querySelector('.node-id');
nodeIdElement.textContent = content;
})
.catch(error => {
console.error('Error fetching PHP file:', error);
});