Javascript best practices – Organize And Modularize Your Javascript Code
June 8, 2017

HTML (Hyper Text Markup Language ) it’s a markup language used to organize data from the Internet and, like the internet, it has evolved immensely since its inception. Standardization of Internet technology is a top priority for the world economy. HTML5 was implemented to reduce reliance on plugins, improve error handling, replace scripting with more markups, to provide a smoother and more consistent experience for web users and developers. Because HTML5 is constantly evolving, browsers are incrementally introducing support for new features.

HTML vs HTML5: What’s New?

  • Deprecated elements like center, font, and strike have been dropped
  • Improved parsing rules allow for more flexible parsing and compatibility
  • New elements including video, time, nav, section, progress, meter, aside and canvas
  • New input attributes including email, URL, dates and times
  • New attributes including charset, async and ping
  • New APIs that offer offline caching, drag-and-drop support and more
  • Support for vector graphics, SVG, without the aid of programs like Silverlight or Flash
  • Support for MathML to allow better display of mathematical notations
  • JavaScript can now run in the background thanks to the JS Web worker API
  • Global attributes such as tabindex, repeat and id can be can be applied for all elements

What Are the Advantages of HTML5 vs HTML for Web Users?

By limiting the need for external plugins, HTML5 allows for faster delivery of more dynamic content.

  • Some data can be stored on the user’s device, which means apps can continue working properly without an Internet connection.
  • Web pages can display more fonts with a wider array of colors, shadows, and other effects.
  • Objects on the page can move in response to the user’s cursor movements.
  • Interactive media, such as games, can run in web browsers without the need for extra software or plugins. Audio and video playback also no longer require additional plugins.
  • Browsers can display interactive 3D graphics using the computer’s own graphics processor.

What Are the Advantages of HTML5 vs HTML for Web Developers?

1. Consistent Error Handling

All browsers have parsers for handling syntactically or structurally improper HTML code, codified error handling can save browser developers a lot of time.

2. Support for More “web application” Features

HTML5 enable browsers to work as application platforms. As websites became more complex, developers had to find ways to “work around” browser extensions and other server-side technologies. HTML5 gives developers more control over the application/ website. Many of the Flash and JS-based hacks commonly used in HTML4 are now elements inherent to the language.

3. Enhanced Element Semantics

The semantic roles of some existing elements have been improved to make the code more suggestive. New elements like section, header, article and nav can replace most div elements, which makes scanning for mistakes a less painful process.

4. Maximized Mobile Support

HTML5 makes mobile support easier by catering to “low-fueled” devices like smartphones and tablets.

5. Support for Custom Data Attributes

Adding custom attributes in a tag was risky before HTML5. The data-* attribute has taken care of this problem. The data-* attribute has multiple uses, but its primary purpose it to store additional information about elements. Data is stored as a simple string. The inclusion of custom data lets developers make more engaging web pages without relying on Ajax calls or server-side lookups.

6. Support to Local Storage

Before HTML5, cookies were a reliable way to store state information. Cookies hold a  limited amount of data, and some web users disable cookies by default. HTML5’s localStorage object provides developers a way to work around the stateless nature of the HTTP protocol. Because it is part of the global window namespace, localStorage may be accessed from any point within scripts. Only string values may be held in local storage, but the JSON.stringify() and JSON.parse() methods make serialization a quick and easy process. Alternatively, sessionStorage allows data to be stored only until the visitor closes their browser.

7. Form Field Autofocus

The form field autofocus attribute lets developers designate which form field will have input focus once the page loads.

8. Script and Link Tags No Longer Require Type Attribute

Since it’s now implied that script and link tags refer to scripts and stylesheets respectively, the need for the type attribute has been eliminated.