|
|
Question : Dynamic Base HREF?
|
|
I have a website with multiple levels of subdirectories. Each of the pages needs to #include a file which contains the menu script.
Now the problems start. I need to include a base href (or some other means) on each page, as the menu script refers to all links & images from the root directory. But my development and production servers have different names and dirs.
Eg Production http://www.somewhere.com/mysite/ Development http://www.somethingelse.com/devmysite/
I have tried to generate a basehref using Javascript. The getBaseDir() function is defined in the file and works fine. When I include the below script, the links just ignore it and are relative to the current pages directory, not the base dir.
Are there any other suggestions on how I can get around this problem?
|
Answer : Dynamic Base HREF?
|
|
Also use + instead of &, and place script in head of document:
document.write('')
|
|
|
|
|