: If I was a betting man, I'd say that the links you provided inside your navigation html are trying to go relative to the URL of the page your're including it from. To test, change the
If I was a betting man, I'd say that the links you provided inside your navigation html are trying to go relative to the URL of the page your're including it from. To test, change the links to absolute (http://www...) and see if they work...if they do, then you know what the problem is.
When I'm confused about includes, I'll load the page and view source. There, you can click on the links and see if they return the included file. You'd be surprised how many times they fail without error. I suspect that the second set of includes you did in the .php file are giving it the css it needs, but the javascript file it needs is what's causing the entire thing to fail. Clicking links in source will tell you for sure.
If the above tests works, you've got choices....leave it absolute, in which case you know where it's going to come from every time, no matter where you include from. Or, you could include the JS from the main file that does the include, which certainly could be appropriate depending on your structure and coding style. Finally, you could change over to .php on the nav file and dynamically condition the URL prior to including it.
More posts by @Nimeshi995
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.