Re: Links to photos don't show up locally on index.html
  Home FAQ Contact Sign in
microsoft.public.expression.webdesigner only
 
Advanced search
POPULAR GROUPS

more...

microsoft ... webdesigner Profile…
 Up
Re: Links to photos don't show up locally on index.html         


Author: Chris Leeds, MVP - FrontPage
Date: Jan 31, 2008 17:46

maybe the easiest solution is to move the JavaScript file to the root of the
site (presumably the level of your index page).
then just reference it at the root /file.js I think you could even put the
JavaScript file online then reference it absolutely with the full
http://address. that'd make sure it was pathed to accurately.

HTH

--
Chris Leeds
Contact: http://chrisleeds.com/contact
Have you seen ContentSeed (www.contentseed.com)?
NOTE:
This message was posted from an unmonitored email account.
This is an unfortunate necessity...
Show full article (1.87Kb)
16 Comments
Re: Links to photos don't show up locally on index.html         


Author: kstrouse
Date: Jan 31, 2008 22:23

Hi Chris and thanks for the suggestion. I did try to put the script into a
file in the root of the site. That didn't change anything. The problem isn't
that the index page doesn't find the code; it does. It just doesn't find the
photos. So I tried a few more things. First, I tried a variety of ways of
preloading the images on the index page, thinking that I'd just try to help
it find the images. That didn't do it. I also moved the gallery photos to the
root directory. But either the index page would find them or the other pages
would find them, but never both types of pages.
As I said, for some reason, the site seems to find the images online, so I
guess I'll just have to live with the empty images while I test it locally.
Thanks.

"Chris Leeds, MVP - FrontPage" wrote:
> maybe the easiest solution is to move the JavaScript file to the root of the
> site (presumably the level of your index page).
> then just reference it at the root /file.js I think you could even put...
Show full article (2.75Kb)
no comments
Re: Links to photos don't show up locally on index.html         


Author: Chris Leeds, MVP - FrontPage
Date: Jan 31, 2008 23:11

it's real weird.
sometimes if I change a reference by appending a ../ to the path it works
out locally and isn't disruptive online.
guaranteed there's a reason for the idicyncracy you've come upon, whether
it's worth figuring out is up to you. ;-)

--
Chris Leeds
Contact: http://chrisleeds.com/contact
Have you seen ContentSeed (www.contentseed.com)?
NOTE:
This message was posted from an unmonitored email account.
This is an unfortunate necessity...
Show full article (3.55Kb)
no comments
Re: Links to photos don't show up locally on index.html         


Author: kstrouse
Date: Feb 1, 2008 01:11

Hey Chris. Yes, I used ../ or not, depending on where I'd stuffed the files.
But no matter where the files were, the reference would work only for the
index page or for the rest of the pages. This is only a local problem, right?
You've had this problem yourself? I've only posted the site once after this
situation arose and it doesn't seem to affect the index page on the server.
But I'll be upset if I go to my site sometime in the future and find missing
photos on the home page.
BTW, my index page is index.htm, not html. That can't possibly matter, can
it? I have no idea why there are two different file extensions.
In the meantime, yes, it's still driving me nuts. I'm on a fairly steep
learning curve here, but I'm trying to create a somewhat organized site. This
isn't helping. I'll...
Show full article (1.50Kb)
no comments
Re: Links to photos don't show up locally on index.html         


Author: Chris Leeds, MVP - FrontPage
Date: Feb 2, 2008 16:35

Hi Karen,
sometimes EW will rename the default file (htm/html, etc) to what it
believes the server wants.
it' shouldn't make a difference.
I think if I were in your situation I'd reference the files with an absolute
path to the server like http://example.com/myscript.js or whatever it would
actually be. at least that way you absolutely know it's pathed correctly.

HTH

--
Chris Leeds
Contact: http://chrisleeds.com/contact
Have you seen ContentSeed (www.contentseed.com)?
NOTE:
This message was posted from an unmonitored email account.
This is an unfortunate necessity...
Show full article (2.38Kb)
no comments
Re: Links to photos don't show up locally on index.html         


Author: kstrouse
Date: Feb 2, 2008 20:12

Hey Chris. I did think about creating an absolute path, but there are two
factors that made me think twice. The first is that the problem seemed to be
a local one, so I was reluctant to add complication to the site, possibly
harming what seemed to be working fine on the live server. As an aside, the
local problem (not seeing images in this JavaScript gallery on the index page
and seeing them fine locally everywhere else on the site) happened whether I
opened the site on my PC in Internet Explorer, Firefox, or Netscape.
The second factor that discouraged me from creating an absolute path was
that the page wasn't having any problem finding the JavaScript code, just the
images. This code is the only place on the site that references the images.
I've since put the images into the same folder with the file that houses the
JavaScript. At one point I had the images in the root directory with the
index.htm file instead. The index page saw them, but no other pages found
them.
I've also tested pulling the code out of the "included" file in which it
resides and making it into a .js file. That didn't work at all, although that
problem might be caused by operator error (me, that is.) I've just started to
read a book about JavaScript, and maybe there are revelations in there that
will give me other ideas.
Another problem with the absolute path is that I'm not always online when ...
Show full article (2.29Kb)
1 Comment
Re: Links to photos don't show up locally on index.html         


Author: Ronx
Date: Feb 3, 2008 11:53

With a CSS page, links in the CSS are always[1] relative to the CSS
file.
With JavaScript, links are always relative to the *page* running the
JavaScript, no matter where the JavaScript is located.

If your pages are in folders at different levels (root folder and any
subfolder are at different levels) then links in JavaScript have to be
changed to suit the page/folder level - hence when using relative links
in an external JavaScript file the links will either work for pages in
the root folder and not for pages in other folders, or the other way
round. Your only option is to use root relative or absolute links.
Root relative links will usually always fail in a disc based web (but
will work when the site is published), absolute links will require an
internet connection to see the images.

Root relative link: /images/pic.jpg
Relative link: images/pic.jpg or ../images/pic.jpg (for page in a
folder)
Absolute link: kttp://www.example.com/images/pic.jpg
Show full article (3.85Kb)
no comments
Re: Links to photos don't show up locally on index.html         


Author: kstrouse
Date: Feb 3, 2008 15:15

Hi Ron. Thanks for the explanation. I think everything is working the way
that you predicted.
The JavaScript and every page except the index page are on the same level,
one folder below the root. The index is on the root directory, of course. All
of the links are relative, as ../images/pic.jpg .
Root relative links would apparently give me the same local experience I
have now (indeed, I might have tried that without knowing the term for it
during my various tweaking experiences) and the same online experience.
Absolute links would drive me nuts, absolutely, while I test the site
offline. It certainly wouldn't solve my problem; it would magnify it.
The slideshow doesn't work on the home page locally. It only works on the
home page live on the server. I didn't understand your comment...
Show full article (2.56Kb)
1 Comment
Re: Links to photos don't show up locally on index.html         


Author: Ronx
Date: Feb 3, 2008 15:36

The images are referenced in the JavaScript as (for example)
../Galleryphotos/gallery8.jpg
For any page in a folder, this means go to the parent folder (root
folder for 1 level down from the root), then to Galleryphotos folder -
no problems.
For the home page, however, this means go to the root folder's parent
folder and then to Galleryphotos in this folder. This is NOT a folder
in your website.

As I said, I have no idea where in the code this path is corrected and
the ../ part dropped.

Unless your local site is running on a server root relative links would
give you no image display in any page, since the root folder in a
disc-based web is actually the root folder of the hard disc.
--
Ron Symonds - Microsoft MVP (FrontPage)
Reply only to group - emails will be deleted unread.

http://www.rxs-enterprises.org/fp

"kstrouse" discussions.microsoft.com> wrote in message
news:E36C1002-9805-4F1F-84E3-7C18E9C5E702@microsoft.com:
> Hi Ron. Thanks for the explanation. I think everything is working the way
> that you predicted.
> The JavaScript and every page except the index page are on the same level,
> one folder below the root...
Show full article (3.60Kb)
no comments
Re: Links to photos don't show up locally on index.html         


Author: kstrouse
Date: Feb 3, 2008 18:06

Hmmm. I see what you mean now. This is a hosted site (on GoDaddy.) There's no
doubt that my root directory is indeed a subdirectory on some server. Now I
can't figure out why it's working either, unless GoDaddy has some magic
hosting code out there that I don't know about. Yikes.
If there were some place that I could put the images that all directories
would see them the same way, I would. But I can't come up with a way to put
all the HTML pages on the same level that isn't the root level. I really
don't want to have dozens of HTML files at the root level.
What does everybody else do? Certainly I can't be the only person on earth
whose pages that share navigation code aren't all in the root directory.

Karen

"Ronx" wrote:
> The images are referenced in the JavaScript as (for example)
> .../Galleryphotos/gallery8.jpg
> For any page in a folder, this means go to the parent folder (root
> folder for 1 level down from the...
Show full article (1.63Kb)
1 Comment
1 2