eClerx Most Frequently Asked Latest HTML Interview Questions Answers

What Is An Html5 Web Worker?

Normally if some script is executing in an HTML page, the page remains unresponsive until the scripts execution stops. But an HTML5 web worker is a script (i.e. JavaScript) that keeps executing in background. At the same time user can interact with the page and will not feel any performance degradation.HTML5 Web Worker

HTML5 web worker normally exists in external files and used for long-running CPU intensive tasks but without affecting the User Interface or other scripts.

What Are The Limitations Of Html5 Web Worker?

HTML5 Web worker seems to be very handy in many scenarios (especially for CPU intensive tasks) but it has certain limitations. Few JavaScript objects are not accessible to HTML5 web worker as
•parent object
•window object
•document object.

How Can We Embed Audio In Html5?

HTML 5 comes with a standard way of embedding audio files as previously we don’t have any such support on a web page. Supported audio formats are as follows
•MP3
•Wav
•Ogg.

Below is the most simple way to embed an audio file on a web page.
<audio controls>
    <source src=”jamshed.mp3″ type=”audio/mpeg”>
    Your browser does’nt support audio embedding feature.
</audio>

In above code, src value can be relative as well as absolute URL. We can also use multiple <source> elements pointing to different audio files. There are more new attributes for <audio> tag other than src as below
•controls – it adds controls such as volume, play and pause.
•autoplay – it’s a boolean value which specifies that audio will start playing once it’s ready.
•loop – it’s also a boolean value which specifies looping (means it automatically start playing after it ends).
•preload – auto, metadata and none are the possible values for this attribute.
     •auto means plays as it loaded.
     •metadata displays audio file’s associated data
     •none means not pre-loaded.
eClerx Most Frequently Asked Latest HTML Interview Questions Answers
eClerx Most Frequently Asked Latest HTML Interview Questions Answers

What Are The New Media Element In Html 5 Other Than Audio And Video?

HTML 5 has strong support for media. Other than audio and video tags, it comes with the following tags

<embed> Tag: <embed> acts as a container for external application or some interactive content such as a plug-in. Special about <embed> is that it doesn’t have a closing tag as we can see below

<embed type=”video/quicktime” src=”Fishing.mov”>

<source> Tag: <source> is helpful for multiple media sources for audio and video.

<video width=”450″ height=”340″ controls>
     <source src=”jamshed.mp4″ type=”video/mp4″>
     <source src=”jamshed.ogg” type=”video/ogg”>
</video>

<track> Tag: <track> defines text track for media like subtitles as

<video width=”450″ height=”340″ controls>
     <source src=”jamshed.mp4″ type=”video/mp4″>
     <source src=”jamshed.ogg” type=”video/ogg”>
     <track kind=”subtitles” label=”English” src=”jamshed_en.vtt” srclang=”en” default></track>
      <track kind=”subtitles” label=”Arabic” src=”jamshed_ar.vtt” srclang=”ar”></track>
</video>

What Are The Different Types Of Storage In Html 5?

HTML 5 has the capability to store data locally. Previously it was done with the help of cookies. Exciting thing about this storage is that its fast as well as secure.

There are two different objects which can be used to store data.
•localStorage object stores data for a longer period of time even if the browser is closed.
•sessionStorage object stores data for a specific session.

What Are The Deprecated Elements In Html5 From Html4?

Elements that are deprecated from HTML 4 to HTML 5 are
•frame
•frameset
•noframe
•applet
•big
•center
•basefront

What Are The New Apis Provided By Html 5 Standard?

HTML 5 standard comes with a number of new APIs. Few of it are as follows

•Media API
•Text Track API
•Application Cache API
•User Interaction
•Data Transfer API
•Command API
•Constraint Validation API
•History API
•and many more

What Is The Difference Between Html 5 Application Cache And Regular Html Browser Cache?

One of the key feature of HTML 5 is “Application Cache” that enables us to make an offline version of a web application. It allows to fetch few or all of website contents such as HTML files, CSS, images, javascript etc locally. This feature speeds up the site performance. This is achieved with the help of a manifest file defined as follows
<!doctype html>
.....

As compared with traditional browser caching, Its not compulsory for the user to visit website contents to be cached.

In order to achieve Application Cache feature in HTML5, a manifest file is used as follows
<!doctype html>
…..

Manifest file is basically a text file that dictates what needs to be cache or not if Application Cache is enabled. Followings are the four main sections of a manifest file where CACHE MANIFEST is the only required section

•CACHE MANIFEST
•CACHE
•NETWORK
•FALLBACK

How To Add Video And Audio In Html5?

Like below we can add video in html5

   <video  width="320" height="240" controls="controls">
    <source src="pcds.mp4" type="video/mp4" />
    <source src="pcds.ogg" type="video/ogg" />
    </video>
And audio like this

  <audio controls="controls">
  <source src="song.ogg" type="audio/ogg" />
  <source src="song.mp3" type="audio/mpeg" />
  </audio>

Describe Any Two New Features Of Html5?

HTML 5 comes up with many new features including video/audio elements for media playback and better support for local offline storage.

What Does A <hgroup> Tag Do?

It is used for heading sections. Header tags used are from <h1> to <h6>. The largest is the main heading of the section, and the others are sub-headings.

Which Video Formats Are Used For The Video Element?

Ogg, MPEG4, WebM.

How Can We Embed Video In Html5?

<video src="movie.ogg" controls="controls"></video>

Which Video Format Is Supported By Ie?

IE supports MPEG4 and WebM.

Name The Audio Formats Supported In Html5?

Ogg Vorbis, MP3, WAV.

What Will The Following Code Do?
<audio Src="song.ogg" Controls="controls"></audio>


It will play the audio file named song.ogg.

How Will You Define Canvas With Reference To Html5?

It is a rectangular area, where we can control every pixel.

How Is Xhtml Better Than Html?

The following are the reasons for why XTML is better than HTML

XHTML uses style sheets instead of font, color and alignment tags of HTML.
XHTML allows to style sheets and scripts embedding in CDATA section.
XML of XHTML eases the integration of new elements as subsets of SGML.
Portable – Non-pc platforms can be accessed with XHTML.

Post a Comment

Previous Post Next Post