473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

base href problems

I have some pages where I need to use a base href tag.

Mac behaviour is different than PC.

I have this:

<base href="http://some_domain.com" />

The page would be: some_domain.com/some_directory/some_page.htm

If I use a relative link:

<a href="some_other_page.htm">some other page</a>

IE5 PC goes here: some_domain.com/some_directory/some_other_page.htm

IE5 Mac goes here:
some_domain.com/some_other_page.htm

Which is correct?

Jeff
Jul 20 '05 #1
6 5779
"Jeff Thies" <no****@nospam.net> wrote in message
news:Tq*******************@newsread1.news.atl.eart hlink.net...
I have some pages where I need to use a base href tag.

Mac behaviour is different than PC.

I have this:

<base href="http://some_domain.com" />

The page would be: some_domain.com/some_directory/some_page.htm

If I use a relative link:

<a href="some_other_page.htm">some other page</a>

IE5 PC goes here: some_domain.com/some_directory/some_other_page.htm

IE5 Mac goes here:
some_domain.com/some_other_page.htm

Which is correct?


According to the spec:
http://www.w3.org/TR/html4/struct/links.html#h-12.4

I would say the Mac version is correct.

Regards,
Peter Foti
Jul 20 '05 #2
"Jeff Thies" <no****@nospam.net> wrote:
I have some pages where I need to use a base href tag.
No, you don't. You never need to use it. It can always be replaced by
the use of suitable absolute URLs.
Mac behaviour is different than PC.
There are lots of browsers on each platform. Could you give a small
hint of what you mean, like the first letters of the browser names?
<base href="http://some_domain.com" />
There is currently no such domain. It isn't a suitable fictitious
sample either, since it lacks the .example indicator.
The page would be: some_domain.com/some_directory/some_page.htm
What page is that? It's a relative URL, which probably means something
quite different from what you expect.
If I use a relative link:

<a href="some_other_page.htm">some other page</a>

IE5 PC goes here: some_domain.com/some_directory/some_other_page.htm
No, it does not.
IE5 Mac goes here:
some_domain.com/some_other_page.htm
No, it does not.
Which is correct?


Neither. Please post some facts for an analysis, or check the URL
specifications yourself.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #3
In article <Tq*******************@newsread1.news.atl.earthlin k.net>,
"Jeff Thies" <no****@nospam.net> wrote:
I have some pages where I need to use a base href tag.

Mac behaviour is different than PC.

I have this:

<base href="http://some_domain.com" />

The page would be: some_domain.com/some_directory/some_page.htm

If I use a relative link:

<a href="some_other_page.htm">some other page</a>

IE5 PC goes here: some_domain.com/some_directory/some_other_page.htm

IE5 Mac goes here:
some_domain.com/some_other_page.htm

Which is correct?


IE Mac. Seems IE5 PC ignores the BASE element for some reason. Try to
find out why, because it normally does not ignore it like that.

--
Kris
kr*******@xs4all.netherlands (nl)
"We called him Tortoise because he taught us" said the Mock Turtle.
Jul 20 '05 #4
In article <Tq*******************@newsread1.news.atl.earthlin k.net>
in comp.infosystems.www.authoring.html, Jeff Thies
<no****@nospam.net> wrote:
I have some pages where I need to use a base href tag.
May one ask why? Often people jump at that as a solution for a
particular problem, when in fact a different solution would be
better.
Mac behaviour is different than PC.
<base href="http://some_domain.com" />
The page would be: some_domain.com/some_directory/some_page.htm If I use a relative link:
<a href="some_other_page.htm">some other page</a>
IE5 PC goes here: some_domain.com/some_directory/some_other_page.htm
IE5 Mac goes here: some_domain.com/some_other_page.htm

Which is correct?


The Mac version. BASE means that any relative URLS should be
resolved relative to that rather than to the actual URL of the page.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #5
Jeff Thies wrote:
I have this:

<base href="http://some_domain.com" />


Well, since domains aren't allowed to have underscores, this can't be an
actual address. (If you want to cite a hypothetical address, you could
use one of the RFC-compliant names allocated for this purpose such as
"example.com", "example.org", "whatever.example", etc.)

I would suggest you include the trailing slash in the URI, as
"http://somedomain.example/"; while it's not mandatory in this case,
there may be some browser bugs in interpreting relative references to a
base URI without the slash. (If it were a URI ending in a subdirectory
name rather than a domain name, the slash would be necessary to cause
the base to be that directory rather than a filename within the
directory one level higher.)

Also, the "/>" ending is valid only in XHTML; if you're using an HTML
doctype, ">" should be used instead.

--
== Dan ==
Dan's Mail Format Site: http://mailformat.dan.info/
Dan's Web Tips: http://webtips.dan.info/
Dan's Domain Site: http://domains.dan.info/

Jul 20 '05 #6
On Fri, 17 Oct 2003, Daniel R. Tobias wrote:
I would suggest you include the trailing slash in the URI, as
"http://somedomain.example/"
<pedant>
Actually, that's not _the_ trailing slash: that's the slash which
separates the domain part of the URL from the URLpath part, as in
http://somedomain.example/path/to/whatever

Just that in this case, the URLpath part is null, but you can imagine
it standing there - to the right of this non-trailing slash ;-)

These two URLs, http://somedomain.example/path/to/whatever and
http://somedomain.example/path/to/whatever/ are definitively
different: they differ by the latter having a trailing slash.

But thes URLs, http://somedomain.example and
http://somedomain.example/ are defined to be identical: they
differ only by omitting the slash which separates the domain part from
the URLpath part, and _that_ slash is optional when the URLpath part
is empty.

</pedant>
; while it's not mandatory in this case,
right
there may be some browser bugs in interpreting relative references to a
base URI without the slash.


I'm not disagreeing with that. Just quibbling over terminology.

cheers
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Harag | last post by:
Hi all I'm using W2k Pro, ASP 3, IIS 5 & DWMX 6.1 and code in VBSCRIPT I currently use the <BASE href=XXXX> in all my pages and just read that this tag is no longer supported so will soon...
3
by: John Smith | last post by:
Is there a way to get Javascript to obey the <BASE HREF=""> tag? I have some code that redirects a user to a template on a different domain, but it keeps taking me to the current domain. Code...
7
by: Weston C | last post by:
I'm trying to get the href attribute from the base tag in the document head. The following does not seem to work... any ideas what I'm doing wrong? if(!(document.getElementsByTagName) ||...
1
by: Jeff Thies | last post by:
I have a template driven site, the template is full of images and links. At some point (during a secure order) the user is redirected to a secure server (different domain) using the same...
10
by: Udi Zisser | last post by:
Hello, any idea why this does not work? or how do i get this thing to work? <BASE HREF="http://localhost/thedude/"> <META HTTP-EQUIV="Refresh" CONTENT="0; URL=redirect.html"> I'm adding...
3
by: Guoqi Zheng | last post by:
Dear sir, On some of my pages, I used a <base href="http://www.meetholland.com/"> I need to dynamically determine the base href value to different URL based on user session. I am thinking...
2
by: Vincent van Beveren | last post by:
Hey everyone, I've looked for this and I wouldn't know what the best practice would be for solving the following problem. We use a BASE tag in our HTML pages. Now we have some links that use...
3
by: yan | last post by:
Hello everybody, I am new so this is the occasion to say hello to everybody. I have a problem with absolute/relative paths. I have to create a static documentation in html for a project and I have...
1
by: SkipNRun | last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.