HTML API Are they part of the HTML5 standard?

When you read about HTML5 in W3Schools, I come across a section called the HTML API.

This, for example, using geolocation and drag and drop on a web page. An example here is W3Schools.com - geolocation

Now the JavaScript code is placed in the HTML script tag.

So my questions are: are these APIs part of the HTML5 standard? I thought HTML was just HTML, not Javascript, so why does it fit under HTML5?

+6
source share
3 answers

There is no HTML5 standard in the strict sense of “standard” (a regulatory document issued by a recognized international or national authority such as ISO, IEC, CEN or DIN) and probably never will.

HTML5 recommendation from W3C. Although such Recommendations are often referred to as “standards,” the W3C is an industry consortium, not a standardization body.

There is also a WHATWG (community) group that has an online document called HTML Living Standard . It may change without prior or subsequent notice and usually does this almost every day. Therefore, in addition to being issued by the standardization body, it also does not have the basic requirements of standards: the standard has fixed content, and it can only be changed by issuing a new standard (a new version of the standard identified in a unique way so that each version can be cited) .

Considering the question as relevant to the W3C HTML5 recommendation, the answer is that some HTML interfaces are part of this, some of them are not, and some of them are defined in separate documents that are provided in it normatively or non-normatively. A significant part of the basic HTML APIs is an integral part of the Recommendation, such as the specification of the interface used to access the properties of the HTML element (DOM node representing the HTML element) in the client script, i.e. in -side JavaScript client in practice.

Geolocation is not part of or even cited in the W3C HTML5 recommendation. It is described separately in the W3C Geolocation API specification.

The drag and drop API was part of the W3C HTML5 drafts, but was excluded from the specification. It is presented in a draft for HTML 5.1 .

+3
source

I think this is more of a factor for W3Schools, sucking on what it does. Although the HTML5 standard (recently completed! Yay) only sets HTML elements, which I suspect w3schools have added here because they are newer. You are right in believing that this is not an HTML thing, but really a javascript thing.

May I direct you to the Mozilla Developer Network, which is more accurate and amazing. Javascript is developed individually by HTML.

EDIT:

So it looks like what happened here, you came across one of the weird gray areas of standards organization. While HTML5 is a specification directly targeting HTML, there is also a specific function that is good for the age at which we live. One of them is geolocation. The geolocation API was developed by W3 as a means of encouraging support among browser providers. These providers naturally chose ECMAScript (javascript) to support api instead of an HTML tag or something else.

Thus, this is not necessarily part of the HTML standard, but it is something that falls under the influence of W3, because their common concern is the standards that help to develop better on the Internet.

+1
source

Source: https://habr.com/ru/post/977861/


All Articles