客户端浏览器是否下载了HTML Doctype URL? [英] Is the HTML Doctype URL downloaded by the client browser?

查看:73
本文介绍了客户端浏览器是否下载了HTML Doctype URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

是从 http://www.w3.org/TR/html4/ ,或者这只是作为一个模糊的ID告诉浏览器使用严格的处理?



也许浏览器保留 http: //www.w3.org/TR/html4/ 永久保存在本地?

解决方案

正常的网页浏览器会将Doctype只不过是一个魔术字符串,表示标准模式或怪癖模式。他们不会将URI视为URI,也不会下载DTD。他们甚至不使用DTD进行分析,而是使用内置的标签汤分析器。



验证解析器会下载它,如果它们没有本地副本他们可以基于PUBLIC标识符(URI是SYSTEM标识符)进行标识。他们应该缓存它,但很多都没有,到了W3C阻止大多数(如果不是全部)DTD请求在Doctypes中给出的URI的时候 - 他们无法承受带宽。


I was just wondering when I declare a Doctype such as the following:

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

Is strict.dtd read from http://www.w3.org/TR/html4/ or is this just used as an obscure id to tell the browser to use strict processing?

Maybe the browser keeps the content of http://www.w3.org/TR/html4/ permanently stored locally?

解决方案

Normal web browsers treat the Doctype as nothing more than a magic string to indicate standards mode or quirks mode. They do not treat the URI as a URI and never download the DTD. They don't even use the DTD for parsing, having a tag soup parser built in instead.

Validating parsers do download it if they don't have a local copy which they can identify based on the PUBLIC identifier (the URI is the SYSTEM identifier). They should cache it, but lots don't, to the point where the W3C block most (if not all) requests for the DTD at the URIs given in the Doctypes — they couldn't afford the bandwidth.

这篇关于客户端浏览器是否下载了HTML Doctype URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆