HTML - How do css/javascript files get loaded? -
good day!
i have stumbled on problem, , can't seem wrap mind around it.
let's loading page url http://example.com/home
. load html index.php
, displays css , js attached. works charm , how want work.
the problem comes in here, if request url http://example.com/home/test
. still load same html, how made work. now, doesn't load css
, js
files anymore used design. don't have old content anymore in them, content of page itself. clearify:
my css @ first , how it's loaded @ first url example.
body{ margin: 0; background:rgb(0,0,1);}
2nd url css result
<html> html loaded, not css anymore </html>
edit:
the html
file load same on , on again, doesn't listen url
load file, require_once
same html file. path's js , css static
.
my question: how css
, js
files loaded? how can remove effect of /test
in loading files.
i hope explained enough, if not, please , try make more clear.
what need load css or json file specifying root. example: instead of using:
<link rel="stylesheet" type="text/css" href="mystyle.css">
you should use:
<link rel="stylesheet" type="text/css" href="/mystyle.css">
else in case search css file called http://example.com/home/somecss.css instead of http://example.com/somecss.css
Comments
Post a Comment