View Full Version : Absolute and Relative Links in Firefox
05-03-2005, 08:30 AM
please be really clear when replying - thanx
I have a "website" or collection of htm folders on our shared computer.
On my webpages, I will have links to other webpages.
What is the best way to use relative links and be compatible for both IE and Firefox browsers (latest versions)?
Or, if I use absolute links - what is the best way to specify this as the files aren't on a webserver, just our shared computer's harddrive.
I've read somewhere that the forward and back slash are interpreted differently by different browsers, etc.
The page currently loads an IFRAME with an applet which has a Table of Contents. Both tables load the page, but!
The links work in IE, but not in Firefox
I just want the page listing the links to be compatible with both browsers.
05-03-2005, 08:48 AM
FF is a little more persnickety than IE. Both will be happy with absolute links as long as the drive has the same letter on both computers and you use the up (/) slash exclusively to denote directories. However, you also need to use this odd looking convention:
Relative paths that work in one browser should work in another as long as, once again, the up (/) slash is used for directories.
05-03-2005, 01:51 PM
I have a "website" or collection of htm folders on our shared computer.Is this collection always going to stay local, or is it something that will eventually be uploaded to a web server?
What is the best way to use relative links and be compatible for both IE and Firefox browsers (latest versions)?Your 'normal' relative URL will be fine in any user agent.
If you're referring to something in the same directory, then start with just the name of the file or subdirectory: "image/example.png". If the target is in a parent directory, or in a path that 'split off' higher up, then start with two dots (.): "../in-the-parent.html".
Or, if I use absolute links - what is the best way [...]Absolute URLs are awkward to use in a local filesystem, so it's best to avoid them. Particularly if you might move files about, or place them on a server sometime in the future.
I've read somewhere that the forward and back slash are interpreted differently by different browsersThey will interpreted in the same way on the same system, but not necessarily between different systems. For example, a backslash means nothing in a Unix-based filesystem, unlike in Windows. In any case, URLs are separated by the forward variety, so you should always use them: you can't go wrong that way.
The OP can ignore this...
However, you also need to use this odd looking convention:
<a href="file:///C:/webwork/mysite/index.html">It's not actually that odd, if you use it in full:
file://localhost/<drive>/<path>It's just like a regular URL, except that Windows systems introduce a drive specification, unlike Unix-based systems which have no concept of drives. Though some user agents don't need to specify the machine name (localhost, in this case), Opera requires it.
 Not quite true, but certainly a slash and backslash are not treated in the same way.
05-04-2005, 04:18 AM
Ok, so far so good.
(thanx for being gentle Mike)
The files are probably going to stay on the shared drive till I get around to learning how to create/buying a site for whom only people who have registered can logon.
Anyway I do sometimes move the files around or rename folderes so relative is easier for me.
Important added info: we are using Windows based OS.
Would it upset either browser if I used maybe a BASE url?
The only thing is I don't want to specify the base with a drive letter as everyone currently uses something different to access the shared drive.
When I open the page in IE, and ask for properties, it calls the URL:
When I look at the source in Mozilla is says that the URL is:
so how do I set the base url? :confused:
Does IE interpret the forward and back slash as the same for local (intranet)files? That is as an indicator of directory structure?
The links in my Table of contents were created by HTML HELP so they were (automatically) created using the backslash \ .
I would like to specify an alternative url (the software allows this) to point to a Firefox friendly url (presumably with the forward slash/)
just not sure how to specify it given the above prob with the slashies.
thanx for wading through this.
05-04-2005, 04:29 AM
Generally, the / will be understood as either / or \, so try using just /. Also, generally, whatever FF likes, IE will tolerate, at least as far as paths go. so I'd try:
More telling than properties may be the address showing in Mozilla's address bar. If you can copy that and paste it into IE's address bar with good result, there is your answer.
05-04-2005, 06:01 AM
Thanx stax everyone for clearing that up.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.