Includes using links and src?


#1

I have founnd a way the use jquery to allow includes…
http://lukesspot.com/indus_links/index.html
The header, footer, as aside are includes.
I have a link (in all 3 includes) which points to
http://lukesspot.com/indus_links/pages/child.html
I see why the links no longer work and the image is broken. Is there a way to fix this


#2

Make your links rooted-relative references.
instead of “images/facility.jpg”, make the image link “/indus_links/images/facility.jpg” . the / at the beginning is important.


#3

I tried that, the site isnt on a server yet though, just testing it on my desktop also (and recreated the problem on a server)
It there a way to fix this for a site not on a server, like using javascript to change the src of an image as well as the href of certain links?


#4

You should never test a site that is supposed to run on a server in a non-server environment (a lot of the internal variables (e.g. $_SERVER in PHP) are strongly dependent on that).

Nowadays it’s relatively easy to set up a virtual machine that mimics the live environment and if that’s too complicated pretty much every OS comes with a web server already installed.