Forum Moderators: open

Message Too Old, No Replies

Embarrassing Problem: Disappearing DOCTYPE

My DOCTYPE is gone!

         

iandstewart

2:02 am on Jan 14, 2008 (gmt 0)

10+ Year Member



My DOCTYPE is disappearing. Instead of

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " [w3.org...]
<html xmlns="http://www.w3.org/1999/xhtml">

I get…

<html xmlns="http://www.w3.org/1999/xhtml">

It's rather embarrassing for me as it causes the page to fail validation—and who knows what else. To make matters worse I just submitted it to a bunch of galleries (it passed validation locally and on my test site) and now I look like a fool.

Anyone know what's going on here and how to fix it?

[edited by: tedster at 2:27 am (utc) on Jan. 14, 2008]
[edit reason] no urls please [/edit]

penders

1:54 pm on Jan 14, 2008 (gmt 0)

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



Presumably this is ALL browsers? Hence the validation failure.

Is your hosting company preprocessing the page somehow? Injecting adverts perhaps?!

g1smd

12:44 am on Jan 15, 2008 (gmt 0)

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



Are you saving the file as Unicode?

Some Windows systems default to UTF-16-LE when you might have reasonably expected UTF-8.

iandstewart

2:45 am on Jan 15, 2008 (gmt 0)

10+ Year Member



I do believe I've discovered the problem: Domain Masking. I've never had a project before that involved it, as this one does. Apparently this is just what Domain Masking does. Weird.

The files are hosted on domain-a and domain-b is masking them—and removing my doctype. Why this happens is probably a better question.

penders

8:00 am on Jan 15, 2008 (gmt 0)

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



Unless there is another way, Domain Masking is the technique of using a framed document on domain-b to mask the true URL of where the files are located (on domain-a in your case).

This does not remove the DOCTYPE from your page, but you are probably viewing the source of the framed page which may not have a DOCTYPE? If anything, it should perhaps have the following:

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

Your actual page within the frameset should still have the DOCTYPE that you gave it?! Likewise, the rendering of the page should be unaffected?!

Presumably, however, you chose to use domain masking (or 'framed forwarding')...?