Interview Questions HTML5

HTML5


31. Are there things in HTML4 that are not in HTML5?
Yes, but only a handful of elements and these are not really gone; they are just marked as obsolete. Browser makers can continue to support these elements in their new versions and most will. Among the elements marked as obsolete in HTML5 are: frame, frameset, big, center, font, strike, acronym, applet, isindex and dir.

32. What exactly is HTML5 Video?
Nothing, really. The term HTML5 video is used to differentiate the playing of a video directly by a browser encountering a web page?s video element, as opposed to being played by a third-party browser plugin via an object or embed element. There is nothing intrinsic about any video that makes it HTML5-ish as opposed to Flash-ish. The distinction is entirely a matter of how the a web page is coded to present the video.

33. Will HTML5 kill Adobe?s Flash?
Nope, Flash will be around for a long time. As a media player, Flash accommodates digital rights management (DRM) which hasn?t been addressed in the HTML5 specs. As an applications platform, Flash has a large, installed base in corporate environments where there?s no compelling rationale for rewriting working applications in HTML5. For new applications, HTML5 has advantages over Flash: content is better exposed to search engines, there?s complete integration with other document elements, no plugins are required and HTML5 tools are free.

34. Is HTML5 is a threat to Microsoft?
No. Microsoft embraces HTML5. The IE9 beta has received high marks for its HTML5 support. Silverlight is not the only path to interactivity in Redmond.

35. What is an HTML5 application?
There are several new capabilities in HTML5 which directly address the need for creating interactive applications. Of course, HTML has had interactive capabilities since its early days with text-based input forms and HMTL5 expands these with new input types. New capabilities include page and session-based data storage in the user?s browser, Web sockets for inter-application communications, and a drawing environment,  the canvas element, for creating and manipulating image data.

36. What is application cache in HTML5?
One of the most demanded things by end user is offline browsing. In other words if internet connection is not available page should come from browser cache i.e. offline and application cache helps you to achieve the same.
Application cache helps you to specify which files should be cached and not cached.

37. So how do we implement application cache in HTML 5?
The first thing in we need to specify is the ?manifest? file. ?manifest? file helps you to define how your caching should work. Below is the structure of the manifest file :-
CACHE MANIFEST
# version 1.0
CACHE :
Login.aspx

All manifest file starts with CACHE MANIFEST statement.
#( hash tag) helps to provide the version of the cache file.
CACHE command specifies which files needs to be cached.
The content type of the manifest file should be ?text/cache-manifest?.

Below is how cache manifest has been provided using ASP.NET C#.
Response.ContentType = "text/cache-manifest";
Response.Write("CACHE MANIFEST \n");
Response.Write("# 2012-02-21 v1.0.0 \n");
Response.Write("CACHE : \n");
Response.Write("Login.aspx \n");
Response.Flush();
Response.End();

One the cache manifest file is created the next thing is to provide the link of the manifest file in the HTML page as shown below.
<html manifest="cache.aspx">
When the above file runs first time it gets added in the browser application cache and in case server goes down the page is served from the application cache.

38. What is the difference between SVG and <Canvas>?
<Canvas> is an element that manipulates two-dimensional (2D) pixels while Scalable Vector Graphics works in 2D and three-dimensional (3D) vectors. Essentially, <Canvas> is to SVG as Photoshop is to Illustrator.

39. What are data- attributes good for?
The HTML5 data- attribute is a new addition that assigns custom data to an element. It was built to store sensitive or private data that is exclusive to a page or application, for which there are no other matching attributes or elements.

40. What is the difference between HTML5 interaction in Sencha and Twitter/Bootstrap?
Sencha and Twitter/Bootstrap are both HTML development frameworks that integrate HTML5, CSS3, and JavaScript. The major difference is that in Sencha, the three languages are all comingled together in code, whereas in Bootstrap, HTML and CSS and decoupled.