Forum Moderators: open

Message Too Old, No Replies

XHTML won't work in Netscape 6.2!

Must I resort to HTML 4?

         

Hester

10:37 am on Apr 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A group of users who visit our site at work have recently been 'upgraded' to Netscape 6.2. One of them informed me that our site completely crashes the browser. So I did a series of files based on the first page, but with bits missing to see what the problem was.

I also looked for a solution and came across this Webmaster forum thread, which details a bug regarding the DOCTYPE you must use:

[webmasterworld.com ]

When I copied the HTML 4 DOCTYPE said to be safe for NS 6.2 from there, my page then worked. I also upgraded a Javascript file as that was known to cause odd problems too.

I thought it was the Javascript at fault, so I went back to my standard DOCTYPE, which is the XHTML Transitional one. Now the user gets a blank screen. Other pages on the site are missing elements. They also crash the browser again.

So I switched back to the HTML 4 DOCTYPE and the user can now view my page correctly.

Is there a known bug with using an XHTML DOCTYPE in Netscape 6.2? I don't want to lose it, as it might affect positioning and layout in IE6. Also my code really is XHTML.

gph

3:39 pm on Apr 3, 2003 (gmt 0)

10+ Year Member



Does it work in Moz 1x?

tedster

6:05 pm on Apr 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm confused whether your HTML is actually XHTML or HTML 4. I can see that using a doctype for one when your HTML is the other could make for trouble, and thee's a decent sized gap between XHTML and HTML.

felix

6:12 pm on Apr 3, 2003 (gmt 0)

10+ Year Member



If you already tried this, ignore, but the validator on w3.org should find any inconsistancies between your doctype declaration and the actual code.

DrDoc

6:37 pm on Apr 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm using XHTML1.0 in Netscape 6.2 without any problems...

Are you sure the code is valid XHTML according to the DOCTYPE? Also, you're not "hiding" any CSS or JavaScript in <!-- -->, are you?

TheWebographer

9:27 pm on Apr 3, 2003 (gmt 0)

10+ Year Member



Yes it is true, certain DOCTYPE's will mess up the rendering in Nutscrape Navigator. I discovered this on our xhtml valid website. By removing the Doctype tag, Nutscrape renders it properly.

I checked this out by doing a search on Google. Sure enough, it is a common problem.

So much for standards

gph

9:55 pm on Apr 3, 2003 (gmt 0)

10+ Year Member



TheWebographer, I think you found lots of problems in your search because too many people code for a browser that fills in the blanks in incorrect code. They fire up NN when it's close to complete and find problems.

Naturally IE is by far the most used browser and therefore their most important consideration but consider this. Moz is compliant and unforgiving, if you code for it using what IE can handle there will be no errors in IE. IMO a much easier route.

Hester

8:32 am on Apr 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



gph: Does it work in Moz 1x?

Yes

tedster: I'm confused whether your HTML is actually XHTML or HTML 4.

My original code is written as XHTML. Therefore my doctype is also XHTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

felix: If you already tried this, ignore, but the validator on w3.org should find any inconsistancies between your doctype declaration and the actual code.

Ah, now I'm having problems. If I validate the file offline it gives an error:

"Sorry, I am unable to validate this document because its content type is application/octet-stream, which is not currently supported by this service."

What the....?

So I uploaded the file but suddenly styles aren't working! Agh! So I validated a similar page using my usual XHTML doctype and got this:

"I was not able to extract a character encoding labeling from any of the valid sources for such information. Without encoding information it is impossible to validate the document. The sources I tried are:

* The HTTP Content-Type field.
* The XML Declaration.
* The HTML "META" element.

Since none of these sources yielded any usable information, I will not be able to validate this document. Sorry. Please make sure you specify the character encoding in use."

OK, the first one leads me to this line in my code - is it incorrect?


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

Secondly, the XML declaration was removed due to the IE6 bug where it doesn't recognise the doctype if it's on line 2.

Thirdly, I only have the standard META tags in place for things like author and description etc. I don't have one to define the character encoding.

Looks like I've slipped up somewhere. What should I do to retain XHTML and make it work in NS 6.2 and also the W3C Validator?

felix

10:45 pm on Apr 4, 2003 (gmt 0)

10+ Year Member



Would it be possible for you to strip everything out of your document except...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
Check on <a href="http://validator.w3.org/check/referer">w3.org valitator</a>.
</body>
</html>

...and then add it back bit by bit until it breaks?

TheWebographer

10:45 pm on Apr 4, 2003 (gmt 0)

10+ Year Member



GPH,

Even in valid markup, Netscape will sometime choke on

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

g1smd

12:12 am on Apr 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Nowhere in the above two posts is there a Character Encoding declaration shown.
That is a required element.

toolman

12:19 am on Apr 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



try it just like this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">

Betcha it works...sometimes there's an extra space in those decs that makes NN choke.

I have a flat spot on the side of my head from banging it against the desk with this one. ;)

felix

11:40 am on Apr 5, 2003 (gmt 0)

10+ Year Member



g1smd,

The character encoding is specified in the xml declaration (encoding="UTF-8"). This quote is directly from the XHTML recommendation.

Here is an example of a minimal XHTML document.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Virtual Library</title>
</head>
<body>
<p>Moved to <a href="http://vlib.org/">vlib.org</a>.</p>
</body>
</html>

Note that in this example, the XML declaration is included. An XML declaration like the one above is not required in all XML documents. XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16.

Here is the URI to the section titled "Document Conformance".

http://www.w3.org/TR/2000/REC-xhtml1-20000126/#docconf

Hester, Let us know if toolman's suggestion works. That's a great tidbit about NN.

Hester

8:30 am on Apr 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



felix - I can't test it bit by bit as it depends on another user trying it out remotely, and I don't want to give them too much work.

I will try the new doctype suggested by toolman, and see what happens.

I'm also reluctant to add the XML declaration as IE6 switches to Quirks Mode if that's there. Can anyone suggest a way to get the character encoding correct so the page will be validated?

DrDoc

7:16 pm on Apr 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is what I'm using. It works, and it validates:

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html;charset=ISO-8859-1" />
<meta http-equiv="Content-language" content="en" />

You can even replace Strict with Transitional (both instances) and it will still work in NN6.2 (and validate)

DrDoc

7:18 pm on Apr 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Note: Copy it just the way it is, with line breaks and everything...

Hester

9:02 am on Apr 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Toolman: try it just like this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">

Betcha it works...sometimes there's an extra space in those decs that makes NN choke.

Yep! That worked. I'm now trying DrDoc's more complete version and seeing if that works.

Hester

11:33 am on Apr 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Everything seems to be okay now, but the page comes up with some strange results when validating.

2. Line 100, column 168: document type does not allow element "table" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

...with address, emails and search form">


Original line:

100: <p id="holdall"><br /><table id="main" width="760" cellpadding="0" cellspacing="10" border="0" summary="Table used for page layout with address, emails and search form">

Surely table is valid XHTML Transitional?

7. Line 139, column 12: reference to non-existent ID "searchbutton"

<label for="searchbutton"><input type="submit" value="Search" /></label>

8. Line 140, column 18: reference to non-existent ID "resetbutton"

&nbsp;<label for="resetbutton"><input type="reset" value=" Clear " /></label>

9. Line 137, column 12: reference to non-existent ID "q"

<label for="q"><b>Regional Contracts Search:</b>&nbsp;<input type="text" name="q"


The last variable "q" is what is passed to another page via a form and PHP. But why are the labels incorrect? Do I need to add redundant IDs to the form elements to match the label names?

g1smd

6:22 pm on Apr 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>> Surely table is valid XHTML Transitional? <<

It is, but you missed the point of what the error message said:

>> document type does not allow element "table" here; <<

That probably means that you simply have a nesting error, usually caused by trying to nest a block level element inside an inline element.

.

I need to think about your other question on IDs.

axisoftime

6:42 pm on Apr 11, 2003 (gmt 0)

10+ Year Member



certain DOCTYPE's will mess up the rendering in Nutscrape Navigator

LOL... Nutscrape.

Hester

9:16 am on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can't see a nesting problem, though my table is inside a div. (Essential for hiding and moving elements using a print-only stylesheet.)

The start of my code is like this. What is wrong?


<div id="background"><img id="menubase" src="images/backgroundextra.gif" width="150" height="750" border="0" alt="" /></div>


<?php include("menu.html");?>


<div id="printernodiv">
<p id="holdall"><br /><table id="main" width="760" cellpadding="0" cellspacing="10" border="0" summary="Table used for page layout with address, emails and search form">

The ID's aren't essential, but they help to show what each part does in Mozilla's DOM Inspector.

DrDoc

9:58 am on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The table isn't allowed inside the paragraph...

Hester

10:55 am on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, no, no! I always put tables inside paragraphs to make them spaced properly in Opera 6. Surely it cannot be "wrong"?

DrDoc

11:09 am on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yep, unfortunately it is. Same thing goes for headings, lists, and other block-level elements.