let http = require('http');
let fs = require('fs');
let handleRequest = (request, response) => {
response.writeHead(200, {
'Content-Type': 'text/html'
});
fs.readFile('./40.html', null, function (error, data) {
if (error) {
response.writeHead(404);
respone.write('Whoops! File not found!');
} else {
response.write(data);
}
response.end();
});
};
http.createServer(handleRequest).listen(3000);
'use strict';
const modal = document.querySelector('.modal');
const overlay = document.querySelector('.overlay');
const btnClose_modal = document.querySelector('.close-modal');
const btnsOpenModal = document.querySelectorAll('.show-modal');
const openModal = function () {
modal.classList.remove('hidden');
overlay.classList.remove('hidden');
};
const closeModal = function () {
modal.classList.add('hidden');
overlay.classList.add('hidden');
};
for (let i = 0; i < btnsOpenModal.length; i++) {
btnsOpenModal[i].addEventListener('click', openModal);
}
btnClose_modal.addEventListener('click', closeModal);
overlay.addEventListener('click', closeModal);
//Handling an Esc_Keypress Event
document.addEventListener('keydown', function (e) {
if (e.key === 'Escape' && !modal.classList.contains('hidden')) {
closeModal();
}
});
[
{
"name": "Ferdinand Carney",
"phone": "(640) 447-3254",
"email": "in@aol.net",
"address": "563-4648 Curabitur Street",
"position_name": "Mauris eu turpis. Nulla aliquet. Proin velit. Sed malesuada augue",
"department": "nisi magna sed dui. Fusce aliquam, enim nec tempus scelerisque,",
"hire_date": "Dec 24, 2020"
},
{
"name": "Deborah Gonzales",
"phone": "1-258-431-9358",
"email": "hendrerit@icloud.net",
"address": "705 Pede Avenue",
"position_name": "dui nec urna suscipit nonummy. Fusce fermentum fermentum arcu. Vestibulum",
"department": "Phasellus dapibus quam quis diam. Pellentesque habitant morbi tristique senectus",
"hire_date": "Oct 25, 2020"
}
]