Includes using links and src?

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

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.

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?

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.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.