By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

Problem with DOCTYPE line

P: n/a
I have a hand-crafted set of HTML files. each file begins with the line:

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

while the master index.html file specifies:

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

The index.html file defines three frames in two nested framesets and
loads separate html documents into these three frames. However, when
the document is loaded into Firefox 1.5.0.7, it displays fine but the
mozilla/firefox loading icon in the upper-right corner just keeps running
and never stops until a different page is loaded. It will not stop even if
the STOP button is pressed. I can separately load the html documents that
go into each frame and there is no problem but when I load the master file
that defines the frames this problem always occurs. I sliced and diced the
content of that file looking for the problem and finally discovered that if
I changed the DOCTYPE line to simply:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">

Then it loads without a hitch and firefox stops after everything is
displayed.

I'm sure that the problem is elsewhere, but I cannot find any unbalanced
tags, open quotes or anything similar. Does anyone have a clue as to what
is actually happening and where I should look for the real source of the
problem.

Thanks,
--
Jeff
Oct 13 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
VK

Jeffery Small wrote:
I'm sure that the problem is elsewhere
That's a very good guess :-) because DOCTYPE is treated as opaque
string to choose quirk vs. standard mode, that is all of it.
Does anyone have a clue as to what
is actually happening and where I should look for the real source of the
problem.
In one of your frames you are using document.write statements and not
closing output stream with document.close() - so Firefox keeps the
output stream open for more data (this is why the logo stays in the
"loading" state).

Change
document.write(first);
...
document.write(last);

to:

document.write(first);
...
document.write(last);
document.close();

Oct 15 '06 #2

P: n/a
"VK" <sc**********@yahoo.comwrites:
>In one of your frames you are using document.write statements and not
closing output stream with document.close() - so Firefox keeps the
output stream open for more data (this is why the logo stays in the
"loading" state).
>Change
document.write(first);
...
document.write(last);
>to:
document.write(first);
...
document.write(last);
document.close();
VK:

Thanks for the reply. However, at this point I am not even using style
sheets. However, with much additional investigation I believe I did locate
the problem. I had the following LINK entry in the HEAD section to define a
favicon for the page:

<HEAD>
<TITLE>Tanzania 2006</TITLE>
<LINK REL="shortcut icon" HREF="images/CJSA.ico">
</HEAD>

Later, I moved the images subdirectory to a different location. I updated
all of the image links except this one! Apparently, firefox doesn't know
what to do when it cannot find a favicon and it just keeps churning away.
When I fixed the path everything began working as expected.

So now my question is: Why do you think changing:

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

to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">

had an effect on this situation? What does the referencing browser actually
do with the contents of the frameset.dtd file?

Thanks again for your help.

Regards,
--
Jeffery Small
Oct 15 '06 #3

P: n/a
VK

Jeffery Small wrote:
Thanks for the reply. However, at this point I am not even using style
sheets.
That was not about stylesheets but about javascript document.write()
method - a very common issue causing Firefox to stay in "loading" mode.
But this time evidently that was not an issue so my guess was wrong.

<snip>
So now my question is: Why do you think changing:

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

to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">

had an effect on this situation? What does the referencing browser actually
do with the contents of the frameset.dtd file?
It does absolutely nothing (UA's do not load nor even check for
existence external DTD's - not in this situation).

But the presence of opaque URL string switch Firefox into strict
(CSS1Compat) mode while the second syntax leaves it in quirk
(BackCompat) mode. See the original switch rules table at:
<http://msdn.microsoft.com/library/en-us/dnie60/html/cssenhancements.asp>

How does it affect on staying in the "loading" mode for missing picture
- I have no idea.

Oct 15 '06 #4

P: n/a
On Sun, 15 Oct 2006 17:41:39 GMT, je**@cjsa.com (Jeffery Small) wrote:
>So now my question is: Why do you think changing:

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

to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">

had an effect on this situation? What does the referencing browser actually
do with the contents of the frameset.dtd file?
It does nothing with the contents of the file. However you are probably
triggering quirks mode, as VK said. You can find more on the subject via
the usual search tools - but generally your sanity is safer if you use
standards mode, triggered by a full DOCTYPE statement.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Oct 15 '06 #5

P: n/a
Stephen Poley & VK:

Thanks to you both for the explanation and for VK's pointer to the
document on the MS site that further explained the use of the DOCTYPE
declaration.

Regards,
--
Jeffery Small
Oct 15 '06 #6

P: n/a
Jeffery Small wrote:
Stephen Poley & VK:

Thanks to you both for the explanation and for VK's pointer to the
document on the MS site that further explained the use of the DOCTYPE
declaration.
Keep in mind that this MS site is only referring to the way _IE 6_
handles it.

--
Gus
Oct 15 '06 #7

P: n/a
"VK" <sc**********@yahoo.comwrites:
But the presence of opaque URL string
The presence of what?
switch Firefox into strict
(CSS1Compat) mode while the second syntax leaves it in quirk
(BackCompat) mode. See the original switch rules table at:
<http://msdn.microsoft.com/library/en-us/dnie60/html/cssenhancements.asp>
The 'original (as in "case of precedence") switch rules' come from IE 5
for the Mac and are not documented to the best of my knowledge (if you
happen to know better, please share).
--
||| hexadecimal EBB
o-o decimal 3771
--oOo--( )--oOo-- octal 7273
205 goodbye binary 111010111011
Oct 16 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.