My website consists of static HTML pages and a JavaScript file that displays an informational message. I am looking for a way to automatically incorporate the .js file into every page on the site without having to manually add it to each individual page. Is this something that can be achieved through the use of .htaccess or another system?
I am not interested in redirecting to a different page, but rather embedding the JavaScript code directly onto each existing page. While I have limited knowledge of .htaccess, I would greatly appreciate it if someone could provide me with examples of code that could potentially help me achieve this. I am hoping that there is someone in this forum who may be able to assist me.
Thank you in advance for any advice or suggestions provided.
REPLY: In order to include the JavaScript file, you simply need to add
<script type="text/javascript" src="info.js"> </script>
before the closing </body>
tag. However, since there are hundreds of pages on your site, manually editing each one using something like Notepad++ would be extremely time-consuming. Please let me know if there is a faster solution available.