Im working on a dynamic paging website (Essentially clicking a link and it loads the content without a page-refresh (ajax).
My problem is when I got example.com/first/second it messes up the javascript and css directories (as the browser can’t find those since it’s doing /first/example.css and not /example.css). I tried doing:
$Dots = $_SERVER['DOCUMENT_ROOT'];
And adding that before the link to my css/javascript. This didn’t work, so what can I do?
set the absolute path to the css file
/path/to/css_file.css (note the slash beore path)
you should do the same thing for the javascript files