Gecko based browsers (Mozilla & Netscape) link issue

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Post Reply
number6car
Posts: 4
Joined: December 23rd, 2014, 8:33 am

Gecko based browsers (Mozilla & Netscape) link issue

Post by number6car »

I have an asp page that works fine with Chrome, IE, and Safari but Firefox behaves differently. See http://tournamenttime.net/tournaments.asp. If you hover over the icons in the Flyer or URL fields you'll see the address that it's suppose to go to (and does so flawlessly in the browsers mentioned). In Firefox "http://tournamenttime.net" is added in the front of the address which breaks the link. Is this a Firefox (Gecko) specific issue or is it my configuration in the global.asa, calling script or somewhere else that causes this? Like I say, all other browsers connect to the links without issue. Thanks.

Dan
User avatar
Gingerbread Man
Posts: 7735
Joined: January 30th, 2007, 10:55 am

Re: Gecko based browsers (Mozilla & Netscape) link issue

Post by Gingerbread Man »

You're using backward slashes in the href attribute of the a element. You should be using forward slashes instead. As an example, here's what you have on the page currently, followed by what the HTML code should be:

Code: Select all

<a href="http:\\www.Tournamenttime.net\Flyers\2015basschamps.pdf"><img src="images/Flyer.gif" border="0" height="16" width="16"></a>

Code: Select all

<a href="http://www.Tournamenttime.net/Flyers/2015basschamps.pdf"><img src="images/Flyer.gif" border="0" height="16" width="16"></a>

When the files are on the same domain as the page you're liking from, you can use relative paths instead:

Code: Select all

<a href="Flyers/2015basschamps.pdf"><img src="images/Flyer.gif" border="0" height="16" width="16"></a>

Run your site through the markup validator to find other problems:
:arrow: W3C Validator results for tournaments.asp: 94 errors, 4 warnings.
number6car
Posts: 4
Joined: December 23rd, 2014, 8:33 am

Re: Gecko based browsers (Mozilla & Netscape) link issue

Post by number6car »

I acknowledge that the slashes may be going the wrong way, but that doesn't explain why IE, Chrome and Safari resolve the addresses without issue and Firefox adds the local site name to the beginning of the link.
User avatar
trolly
Moderator
Posts: 39851
Joined: August 22nd, 2005, 7:25 am

Re: Gecko based browsers (Mozilla & Netscape) link issue

Post by trolly »

It does. While Firefox interprets things strict to the standards the other browsers allow users doing stupid and illegal things.

Or short, a backslash is not a valid separator in an URI.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Gecko based browsers (Mozilla & Netscape) link issue

Post by Frenzie »

trolly wrote:It does. While Firefox interprets things strict to the standards the other browsers allow users doing stupid and illegal things.

Ftr, the behavior might be different if the site weren't in quirks mode.
Intelligent alien life does exist, otherwise they would have contacted us.
number6car
Posts: 4
Joined: December 23rd, 2014, 8:33 am

Re: Gecko based browsers (Mozilla & Netscape) link issue

Post by number6car »

Frenzie,

Should I add a DOCTYPE for strict mode on the asp page to change the behavior (and change slashes)?
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Gecko based browsers (Mozilla & Netscape) link issue

Post by Frenzie »

Except on legacy pages, I doubt there is any reason not to use a DTD in 2014. Browsers behave significantly more alike when you do. The slashes should be changed regardless, although in this case it only makes a difference in the slightly outdated Opera/Presto. I'm negatively surprised that nothing changed about Blink's or IE10's behavior in strict mode, but apparently it's a willful violation of URL parsing in the spec: https://bugzilla.mozilla.org/show_bug.cgi?id=652186 (Presumably simply motivated by IE's buggy behavior and Webkit's copying it…)
Intelligent alien life does exist, otherwise they would have contacted us.
number6car
Posts: 4
Joined: December 23rd, 2014, 8:33 am

Re: Gecko based browsers (Mozilla & Netscape) link issue

Post by number6car »

Adding the strict DOCTYPE didn't resolve the issue. It still prepends the site name to the links. (see tournaments2.asp) The other browsers still resolve "correctly".
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Gecko based browsers (Mozilla & Netscape) link issue

Post by Frenzie »

Like I said, in this particular case it only seems to make a difference in Opera/Presto. In quirks mode it copies IE's behavior; in standards mode it behaves what I would call correctly. That is, it behaves the same as Firefox. However, more generally speaking quirks mode affects anything from document.documentElement to CSS handling of properties like padding and margin. In IE document.getElementById('bla') returns things like <a name="bla"> in quirks mode. And so on, and so forth.

PS The DTD you added (<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">) still results in quirks mode in every browser afaik. You probably want either

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

or simply

Code: Select all

<!DOCTYPE html>
Intelligent alien life does exist, otherwise they would have contacted us.
User avatar
jscher2000
Posts: 11742
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: Gecko based browsers (Mozilla & Netscape) link issue

Post by jscher2000 »

The DOCTYPE doesn't affect whether Firefox likes backslashes in URLs. It never likes them. Unfortunately, you'll need to globally replace them to forward slashes to fix your links for Firefox users.

Note: Alternately, you might also be able to create a 404 page that redirects to the correct sites when given the broken URLs, but I haven't tried to do it myself and it would depend on whether your host allows ASP in 404 pages.
User avatar
LoudNoise
New Member
Posts: 39900
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Re: Gecko based browsers (Mozilla & Netscape) link issue

Post by LoudNoise »

However, the proper DOCTYPE will make it more likely that all browser will show it more or less the same way (assuming proper coding) if I am not mistaken.

Also, almost every text editor will allow you to "\" to "/" with a simple click on Edit --> Search and Replace.
Post wrangler
"Choose between the Food Select Feature or other Functions. If no food or function is chosen, Toast is the default."
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Gecko based browsers (Mozilla & Netscape) link issue

Post by Frenzie »

That's what I've been saying. Using standards mode avoids a whole slew of potential issues along these lines and as such quirks mode is almost certainly a bad idea. That only Opera/Presto changes its behavior in this particular case is pretty much irrelevant to the general point.
Intelligent alien life does exist, otherwise they would have contacted us.
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: Gecko based browsers (Mozilla & Netscape) link issue

Post by patrickjdempsey »

I believe that when Firefox sees:

Code: Select all

<a href="http:\\www.Tournamenttime.net\Flyers\2015basschamps.pdf">


It cannot recognize it as a URL at all and is interpreting it as a relative path within the current domain. Imagine the backslashes are dashes:

Code: Select all

http:--www.Tournamenttime.net-Flyers-2015basschamps.pdf


So this is how Firefox is seeing that "address"... as just a really weird name for a pdf with no path information. Without any usable path information, it's correcting that weird file name it by adding the relative path:

Code: Select all

http://www.Tournamenttime.net/http:--www.Tournamenttime.net-Flyers-2015basschamps.pdf
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/
Post Reply