Thursday, May 9, 2013

Difference Between html and html5



HTML 5 is an updated version of HTML. It’s much similar to HTML. But difference is HTML 5 contains much better support for media such as, an audio and video tag.HTML is a markup language but HTML 5 is new, there is no big difference in both of them. HTML 5 have some tags and attributes which are not in HTML

HTML
1. DOCTYPE is much longer as HTML4 is based on SGML-based.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">


2. Audio and Video are not part of HTML4 specification

3. Vector Graphics is possible with the help of technologies such as VML, Silverlight, Flash etc.
4. It is almost impossible to get true GeoLocation of user browsing any website especially if it comes to mobile devices.
5. Browser cache can be used as temporary storage.
6. Web Sockets are not available. Generally used mechanisms are long polling and streaming.
7. Works with all old browsers
8. Does not allow JavaScript to run in browser. JS runs in same thread as browser interface.

HTML5

1. DOCTYPE is required to enable standards mode for HTML documents.
<!DOCTYPE html>
2. Audio and Videos are integral part of HTML5 specifications e.g. <audio> and <video> tags
3. Vector graphics is integral part of HTML5 e.g. SVG and canvas
4. JS GeoLocation API in HTML5 helps identify location of user browsing any website (provided user allows it)
5. Application Cache, Web SQL database and Web storage is available as client side storage. Accessible using JavaScript interface in HTML5 compliant browsers.
6. Full duplex communication channels can be established with Server using Web Sockets. Accessible using JavaScript interface in HTML5 compliant browsers.
7. Most of modern browser have started supporting HTML5 specification e.g. Firefox, Mozilla, Opera, Chrome, Safari etc.
8. Allows JavaScript to run in background. This is possible due to JS Web worker API in HTML5




1 comment: