• 0

Cross platform director references


Question

Okay, this is driving me nuts. I'm working on a site and it looks fine under Winodws, but on a Mac the image doesn't show up. So if i fix it to work on aMac, it in turn refuses to work on a PC.

Now I could write a detection script, but would rather not just for this, so hopefully someone here cna either point out my error and guided me in the right direction.

Works in Windows:

<body onLoad="window.top.divider.src='../images/borders/bordermusic.jpg';">

Works on Mac:

<body

onLoad="window.top.divider.src='./images/borders/bordermusic.jpg';">

The period at the beginning is the only difference.

Ideas, suggestions, fixes?

Thanks

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

timdorr, thanks for the response, here's the directory structure:

-www

---index.html

---images

------borders

---------border-music.jpg

---music

-------banner.html

and I jutst relaized that I typed in my message incorrectly earlier. thie lines entered go with the opposiste system

Works in Mac:

<body onLoad="window.top.divider.src='../images/borders/bordermusic.jpg';">

Works on windows:

<body

onLoad="window.top.divider.src='./images/borders/bordermusic.jpg';">

sorry about the confusion.

thanks you for taking the time to respond.


Link to comment
Share on other sites

  • 0

From what I can understand from your directory tree mockup, this is where the files are located:

Contents of Root directory: index.html, and images and music directories

Contents of images directory: borders directory

Contents of borders directory: border-music.jpg

Contents of music directory: banner.html

...and it looks something like this:

dirdemo.png

Well, one thing that will definitely work is if you provide the full URL to it (path, file name), that is, you give the absolute path, instead of the relative path. I have found this to be the most effective method of directing to a file.

From what I assume, the file with the relative path reference is the banner.html file in the music directory. I have not ever seen a case where a single period is used instead of a double period to indicate relative paths. Try creating a similar directory structure offline on your hard drive, and see if it works then with the double period. If it does, there may be something wrong with your browser.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.