Skip to content Skip to sidebar Skip to footer

Html1527: Doctype Expected. The Shortest Valid Doctype Is ""

Good day, I am working on a c# web application, everything is working until I add in a normal JavaScript. The html code is something as follow:

Solution 1:

IE issues a warning about <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">, because such a string is not a valid doctype according to HTML5. The warning as such has no impact on anything. It’s just part of HTML5 evangelism.

After you changed it to <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">, the issue was removed. But you probably saw the results of using some cached copy that has a wrong doctype. Testing with a fresh file (with a new name) should fix this issue.

Of course, the code as such does not validate, since the ASP tags are taken literally and interpreted as body content, but that’s a different issue.

The practical move is to use <!DOCTYPE html> as suggested. If you wish to still validate against the XHTML 1.0 specification for example, you can do this using the validator’s user interface to override the doctype.

But it’s not a big issue; you can just as well simply ignore the warning. If you have some functional errors, they are caused by something else and should be asked separately, with sufficient data provided.

Post a Comment for "Html1527: Doctype Expected. The Shortest Valid Doctype Is """