CodeWithCoffee
CodeWithCoffee

Reputation: 1904

HTML5 API vs HTML5 Javascript API

I am reading about HTML5 new apis.

Is there any difference between when we say HTML5 Javascript API and HTML5 APIS.

Those are different APIS ?

Thank you!!

Upvotes: 4

Views: 1524

Answers (2)

Matthew Herbst
Matthew Herbst

Reputation: 32043

That's a very interesting question.

Let's look at what we use today:

  1. the DOM/HTML
  2. additional features that the browser provides
  3. JavaScript

So, first, let's cover HTML5 APIs. The HTML5 spec is defined by w3. A quick scan of that document will show you that "JavaScript" is not mentioned even once.

What the HTML5 spec covers is:

  • New features to the DOM
  • Updates to existing features in the DOM
  • Deprecating and/or removing features in the DOM
  • New APIs that browsers should support
  • Updates to existing API's that browsers support
  • Deprecating and/or removing APIs in the DOM

A small but nice list of the new HTML as with as API changes can be found on w3schools.

Now, you also ask about "HTML5 Javascript APIS"

Here is something to remember: JavaScript is NOT part of the HTML spec. In fact, not every browser implements JavaScript, and the ones that do all implement it slightly differently based on the JavaScript engine being used. For example, Chrome uses the V8 engine, while FireFox uses the SpiderMonkey engine. This is why certain JavaScript features work differently (or not at all) from browser-to-browser.

Further, there isn't really a single thing called "JavaScript." Almost anytime someone says JavaScript, what you're really using is ECMAScript, the current (and upcoming v6) specs you can find here.

So, to recap: HTML5 defines new rules for HTML tags, as well as new rules for what capabilities the browser should give. HTML5 is completely unrelated from JavaScript, which is really ECMAScript.

So, there are no "HTML5 Javascript APIS".

Upvotes: 6

Abhijeet Mukherjee
Abhijeet Mukherjee

Reputation: 59

HTML5

HTML5 APIs that cover a whole slew of functionality and features that can help you create interactive websites, test the performance of your code, interact with a user’s device, and much more.
HTML5 specification has added a number of useful features in new APIs that you may not have delved into yet, likely because of the lack of browser support.

Basic 10 HTML5 APIs are:-
1. High Resolution Time API
2. User Timing API
3. Navigation Timing API
4. Network Information API
5. Vibration API
6. Battery Status API
7. Page Visibility API
8. Fullscreen API
9. getUserMedia API
10. WebSocket API

HTML5 Javascript API

HTML 5 JavaScript API index is automatically generated from the HTML 5 specification documents by scanning them for IDL fragments. The index generator parses the IDL code and link it up to matching headings, creating a cross-reference that can be conveniently navigated using the frames.

Upvotes: 0

Related Questions