In what ways can Progressive Enhancement be applied to improve the functionality of opening files in a new window using PHP and JavaScript?

When opening files in a new window using PHP and JavaScript, it is important to apply Progressive Enhancement to ensure that the functionality works for all users, regardless of their browser or device capabilities. One way to achieve this is by using PHP to generate the necessary HTML attributes for opening the file in a new window, and then using JavaScript to enhance the user experience by adding additional features like a confirmation dialog or custom styling.

<?php
$fileUrl = 'path/to/file.pdf';
?>
<a href="<?php echo $fileUrl; ?>" target="_blank" onclick="return confirm('Are you sure you want to open this file in a new window?');">Open File</a>