开发者

Doctype declaration Internet Explorer error

开发者 https://www.devze.com 2023-04-04 20:46 出处:网络
I have this DOCTYPE declaration on my web page, and it is causing an error in Internet Explorer 8 and prior versions. I\'ve used this DOCTYPE before and have had the page load with no errors in Intern

I have this DOCTYPE declaration on my web page, and it is causing an error in Internet Explorer 8 and prior versions. I've used this DOCTYPE before and have had the page load with no errors in Internet Explorer.

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

This page is working fine in all other browsers. This is the error I receive from IE8 and earlier versions.

The XML page cannot be displayed.

Cannot view XML input using style sheet. Please correct the error and then click the Refresh button.

Unspecified error Error processing resource 'http://www.w3.org/TR/html开发者_JAVA百科4/strict.dtd'.

Any help would be greatly appreciated.


Your XML is probably invalid. Invalid XML should not be processed, except maybe by a repair tool. IE does this right. Please check your page using the W3 validator: http://validator.w3.org/


Try the HTML5 DOCTYPE

<!DOCTYPE html>

It could be because the page isn't being sent with the XML mime type


Most browsers go into quirks mode if the xhtml is invalid but IE will display an error instead if you use xhtml instead. I would suggest either fixing the markup or switching to xhtml-transitional or html5.

0

精彩评论

暂无评论...
验证码 换一张
取 消