Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML APIs - Are they a part of the HTML5 standard?

When reading about HTML5 on W3Schools I have come across a section called HTML APIs.

These are for example how to use geolocation and drag/drop on a webpage. See example here W3Schools.com - geolocation

Now the code is JavaScript and placed inside a HTML script tag.

So my questions is, is these APIs a part of the HTML5 standard? I thought HTML was only HTML and not Javascript so why is this placed under HTML5?

like image 842
Ragnarsson Avatar asked Nov 07 '14 00:11

Ragnarsson


People also ask

Is HTML5 an API?

HTML5 File API aspect provides an API for representing file objects in web applications and programmatic selection and accessing their data. In addition, this specification defines objects to be used within threaded web applications for the synchronous reading of files.

Which API does not come under HTML5?

Drag and drop API was part of W3C HTML5 drafts but was dropped from the specification. It is present in the draft for HTML 5.1. Save this answer.

What are the API used in HTML5?

API stands for Application Programming Interface. An API is a set of pre-built programs that can be used with the help of JavaScript. APIs are used to implement already written code to fulfill the needs of the project you are working on.

What are HTML5 standards?

HTML5 is a markup language used for structuring and presenting content on the World Wide Web. It is the fifth and final major HTML version that is a World Wide Web Consortium (W3C) recommendation. The current specification is known as the HTML Living Standard.


2 Answers

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

There is HTML5 Recommendation by the W3C. Although such Recommendations are often called “standards”, the W3C is an industry consortium, not a standardization authority.

There is also the WHATWG group (community), which has an online document they call HTML Living Standard. It may change without prior or posterior notice, and generally does so almost every day. So in addition to not being issued by a standardization authority, it also lacks a basic requirement of standards: a 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).

Intepreting the question as relating to the W3C HTML5 Recommendation, the answer is that some HTML APIs are part of it, some are not, and some are defined in separate documents cited normatively or non-normatively in it. Much of the basic HTML APIs are an integral part of the Recommendation, such as the specification of the interface used to access the properties of an HTML element (a DOM node representing an HTML element) in client-side scripting, i.e. in client-side JavaScript in practice.

Geolocation is not part of W3C HTML5 Recommendation or even cited in it. It has been described separately in the W3C Geolocation API Specification.

Drag and drop API was part of W3C HTML5 drafts but was dropped from the specification. It is present in the draft for HTML 5.1.

like image 115
Jukka K. Korpela Avatar answered Sep 30 '22 09:09

Jukka K. Korpela


I think this is more of a factor of W3Schools sucking at what it does. While the HTML5 standard (recently completed! yay) sets only HTML elements I suspect w3schools added this on here because it is newer. You are correct in assuming this is not an HTML thing but really a javascript thing.

Might I direct you to Mozilla Developer Network which is more accurate and awesome. Javascript evolves on its own separate of HTML.

EDIT:

So it appears what has happened here is you have stumbled upon one of the weird gray areas of the standards organization. While HTML5 is a specification directly aimed at HTML there are also certain feature that are nice to have for the webapp age we live in. One of these is geolocation. A geolocation API was laid out by the W3 as a means for encouraging support of it among browser vendors. These vendors naturally chose ECMAScript (javascript) to support the api instead of an HTML tag or whatever.

So no this is not necessarily part of the HTML standard but it is something that falls under the W3's sphere of influence because their overall concern is the standards that help to make developing on the web better.

like image 24
Pierre Tasci Avatar answered Sep 30 '22 09:09

Pierre Tasci