I created a webpage with two side-by-side divs. The first div functions as a navigation tree, allowing users to click and load pages on the right div using AJAX. I've successfully added a JavaScript file that is required when certain pages are loaded.
Everything is functioning correctly, but each time a user views the page, the corresponding JavaScript file is included again. This seems like a significant redundancy issue, especially since my knowledge of JavaScript development is limited.
Question: Is there a way to check if a JS file has already been included before adding it again?