firebug returns syntax error in doctype?

妖精的绣舞 提交于 2019-12-18 11:42:36

问题


Why does Firebug return an error in my doctype?

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

error

syntax error
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 

source code

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

回答1:


This usually happens because you are loading an HTML document as a script. This is often caused by <script src=""></script> (i.e. a relative URI pointing at the current, HTML, document)) or one of the scripts pointing to a 404 error.




回答2:


DOCTYPE normally is expressed on one line like below. and can cause syntax error

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

But even sometimes it will yell about a syntax error when a src attribute is not declared for an element. Firebug can also through this error when a source is not found or is called twice on one page. EX: script/image/link.



来源:https://stackoverflow.com/questions/7714896/firebug-returns-syntax-error-in-doctype

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!