URLSeveral HTML elements, most notably the A element, may contain an attribute which takes a URL as value. URLs, Uniform Resource Locators, are addresses of Web documents. More generally, URLs can be used on the Web to refer to "objects" on the Web or in other information systems. The general syntax of absolute URLs is the following: scheme where
Warning: Although many browsers allow you to
omit the part Actually, this pattern is mainly for Web documents, ie An It is safest to enclose URLs in quotes when writing them as attribute values in HTML. For an overview of URLs, see W3C material on addressing. As regards to the technical specifications of the syntax of URLs, see RFC 1738 (absolute URLs) and RFC 1808 (relative URLs). In particular, the specifications say that within a URL only a limited set of characters can be used as such:
Other characters must be encoded. (The characters When a URL occurs as an attribute value in HTML, there is another complication caused by the & character which may have special use in query form submissions. In principle, that character should be escaped as & or as & (there is a footnote in the HTML 2.0 specification about this) and browsers should process it so that the actual URL passed to the processing CGI script has that notation replaced by plain & character. (Notice that it must not be encoded. This is a confusing issue, and CGI scripts should really be written so that semicolon ; and not ampersand & is used as field separator.) Поделитесь этой записью или добавьте в закладки | Полезные публикации |