MetroPulse is a digital news agency that hosts an extensive online archive of historical newspaper articles.
To ensure a professional and uniform appearance across thousands of archived pages, the developers use a single file to manage the visual presentation. The following line is included in the <head> section of every page:
<link rel="stylesheet" type="text/css" href="/assets/styles/main.css">
The site features an interactive archive viewer where users can see the date they accessed the specific record. This is handled by a script included in the page footer.
Part of the script in the file archive_utils.js is shown below:
function updateAccessStamp() {
const stampElement = document.getElementById("access-timestamp");
const currentTime = new Date();
const formattedDate = "Record retrieved on: " + currentTime.toLocaleString();
if (stampElement !== null) {
stampElement.textContent = formattedDate;
}
}
window.onload = updateAccessStamp;
The administrators of MetroPulse want to ensure that their historical records are easily discoverable by researchers using global search engines. They also need to secure the subscriber login area where users manage their accounts.
(a) two benefits of using an external Cascading Style Sheet (CSS) file rather than defining styles internally within each individual HTML document.
(b) the processing that occurs within the client's web browser when the updateAccessStamp() function is executed.