Today, I've encountered an issue with my Bootstrap v4 collapsible hamburger menu on my local XAMPP server. Interestingly, the menu works perfectly fine on my public website when the display is 768px wide in Chrome and Firefox.
I have searched through various StackOverflow threads for a solution but haven't found one that addresses my specific problem. The code for my navbar is identical to the example provided in the Bootstrap class on Lynda.com.
Here's what I know:
I am using the latest minified version of jQuery, and the order of the JavaScript script files in the "head" section of my local XAMPP "index.html" file matches that of the hosted/public server index.html file. The only difference is that I use CDN links to access Bootstrap files on my hosted page and relative paths to access JS/CSS files on my computer for the XAMPP/local website (htdocs is the root folder).
To troubleshoot, I copied and pasted the navbar code block from my public site into my local index.html file hosted on XAMPP. Unfortunately, this did not solve the issue. I have double-checked that the relative folder paths for the JavaScript files on my local XAMPP server are correct (JS files are located in the "js" folder within the root htdocs folder).
I even tried downloading the newest version of jQuery (3.2.1) into my local folder, suspecting that the file might be corrupted, but it didn't resolve the problem. While I assume the functionality of the hamburger menu relies on jQuery, it could also be related to JavaScript.
Upon inspecting the console for errors on my local "index.html" page, I found no issues.
So, why is my hamburger menu failing to work on my XAMPP production server while functioning correctly on my public page? Could it be due to how the JavaScript files are loaded via CDN versus locally stored on my hard drive?
Below are the head and navbar code blocks for my XAMPP production/local server (the non-working code) followed by the code that does function properly. I believe the problem lies in the "head" section and how the JavaScript is linked/accessed.
Any assistance would be greatly appreciated!