Results 1 to 8 of 8
html page break Forum: HTML ForumReplies: 3
Passing variables from HTML page to page Forum: HTML ForumReplies: 1
10-24-2003, 02:46 PM #1
I've encountered problems because the back-end structure of the site consists of multiple hierarchies/levels, but just three of them. (Ridiculous example to clarify: icing level, donut level and jelly level) When the JS is written onto the page, the relative paths assigned for the navigation links are either one or two levels too low, and generate 404s or broken images.
Is there a method (no frames, iFrames or iLayers please) to circumvent this problem without creating a tweaked JS file for each directory level?
Or, even better, is there a method to dynamically change the contents of a div on a page with the contents of a static HTML page without using frames - similar to innerHTML and a variable, but displaying an entire HTML file like a frame would?
10-25-2003, 11:20 AM #2
10-25-2003, 03:59 PM #3
You best bet would be to use absolute paths in all the dynamically generated content. Then the links would work wherever.If one of our members helps you, please click the icon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
11-04-2003, 01:35 PM #4
That was an option I was hoping could be avoided. The development, testing and live environments are on different hosts. I was hoping my mind just wasn't experienced enough to recognize an obvious answer... other than trying to drag them to be at par with the free hosting sites available around the internet. It's still better than hand-coding a thousand pages.
11-05-2003, 04:10 AM #5
11-05-2003, 07:09 PM #6
06-10-2004, 05:38 PM #7
I noticed your question about document.write and multilevel folders and links.
What I have done with a website is create a varible called "up" that is a text string.
For files in my subfolders, I have a locational variable that will be "true" and activate the "up" variable. For files not in subfolders, the locational variable will be false.
Then I put an if-statement in each folder. The if statement, using the locational variable, will assign "up" the string value "../" if my file is in a subfolder, or will be blank if the file is on the same level as the link target.
Similarly, I made a "down" variable that will be assigend a value such as "archive/" if the link target is in a subfolder called "archive" or will be blank if the file and link target are in the subfolder.
So, depending on your location, the variable will be blank or redirect links up or down your heirarchy.
I didn't put the appropriate arrows (<) on the link, because I didn't want it to actually turn into html in this message.
Hope this helps.
09-20-2004, 10:22 AM #8
You could also use '<base href="the/top/directory">' on your page. That way you'd only have to change this value when you move your pages from the test server to the live one.