June 12, 2019

Srikaanth

Dynamic HTML Most Frequently Asking Interview Questions

What Is Logic Match Tag?

Logic match tag is an evaluator which checks the nested body content of tag whether the specified value is an appropriate substring of the requested variable. Matches the variable specified by one of the selector attributes against the specified constant value. If the value is a substring the nested body content of this tag is evaluated.

Or in other words are used to control the generation of page output by allowing conditions to be tested, loops to be set up and application flow to be directed to other pages. A comparison will often involve a bean created with one of the bean tags.

For Example

<logic: match header="User-Agent" value="Mozilla"> Hi Mozilla browser </logic: match>

How Do We Create A Dhtml Drop-down Menu?

1. In order to create a DHTML drop down menu we need JavaScript API. The API (Application Programming Interface) consists of core set of cross-browser JavaScript functions to make DHTML programming easy and quick. This API enables moving and hiding page elements as well as acts as getter and setter of page elements attributes.
2. Second we define on image object and off image object and string containing the URL of the "off" version.
3. Then we create the menu items, label items and sub-menu items. If we wish we can use images also.
4. Then we need to define our own global variables that will be used by the menu. Using global goes against oops design but makes sharing data easier.
5. Create the menubar object, adding the menu labels and writing menubars.
6. Create menu object, adding menu items and writing menus.
7. Hiding and displaying the menus and attaching stylesheet.

What Is Xhtml? Why Is Xhtml Needed? Advantages Of Using Xhtml Rather Than Html?

XHTML stands for Extensible Hypertext Markup Language and is a cross between HTML and XML. It helps us to create better formatted code for site. It makes site more accessible.

Need for XHTML : XHTML has a more strict syntax rules in comparison of HTML. XHTML gives you a more consistent, well structured format so that your webpages can be easily parsed and processed by present and future web browsers. It also makes your website more easy to maintain, edit, convert and format in the long run.

Benefits

1. XHTML documents are XML conforming. As such, they are readily viewed, edited, and validated with standard XML tools.
2. XHTML documents can be written to operate better than they did before in existing browsers as well as in new browsers.
3. XHTML documents can utilize applications like scripts and applets that rely upon either the HTML Document Object Model or the XML Document Object Model.
Dynamic HTML Most Frequently Asking Interview Questions
Dynamic HTML Most Frequently Asking Interview Questions

Describe How Dhtml Work With Javascript.?

As DHTML is not a language and it just use the property of HTML, JavaScript and CSS to make dynamic content. So here I will represents the working of DHTML with JavaScript with a simple example that just greets user with its name

<! DOCTYPE html PUBLIC "-//abc//DTD XHTML 1.1//EN" "http://www.abc.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.abc.org/1999/xhtml">
<head>
<title>DHTML example</title>
<script type="text/JavaScript">
     function greet_user()
     {
          var name=document.getElementById(“userName”).value;
     if(name==””)
          {
                    alert(“Welcome”+name);
          }
          else
          {
                    alert(“Please provide User Name”)
          }
     }
</script>
</head>
     <body>
          <table border=”1” cellspacing=”3”>
          <tr>
                    <td colspan=”2”><h6> Please Enter Your Name </h6></td>
          </tr>
          <tr>
                    <td><h4>User Name </h4></td>
                    <td><input type=”text” id=”userName” ></td>
          </tr>
          <tr>
                    <td colspan=”2”><input type=”button” value=”Submit” onclick=”greet_user()”/>
          </table>
     </body>
</html>

Distinguish Between Static Vs. Dynamic Html?

1. The easiest difference is static HTML once rendered cannot be changed on the other hand dynamic HTML can be changed.
2. Static web pages cannot have database access but dynamic pages can be connected to database.
3. Using static HTML no interactions persist between user and server but dynamic HTML has capability to interact with the user.
4. Static HTML does not require server side coding but dynamic HTML requires server side coding.
5. No animation, games can be developed using the static HTML but on the other hand dynamic HTML can perform this task.

Explain The Working Of Dhtml.?

DHTML as it is combination of HTML as well as JavaScript and it uses the HTML to render the text on the browser. It also uses DOM dynamic Object Model which renders its every element as an Object that can be changed by setting properties and methods. This is done with the help of Scripting. DHTML is part of the general computing trend of late '90s. This is a trend different from structured programming, with a focus on actions and toward object-based programming, where the objects can be compared to nouns in our language.

DHTML allows scripting languages to change variable in a web page's definition language, which in turn affects the look and function of otherwise "static" HTML page content, after the page has been fully loaded and during the viewing process.

What Is Dhtml? What Are The Features Of Dhtml?

DHTML stands for Dynamic HTML. The first thing that we need to clear about DHTML is that it is neither a language like HTML, JavaScript etc. nor a web standard. It is just a combination of HTML, JavaScript and CSS. It just uses these languages features to build dynamic web pages. DHTML is a feature of Netscape Communicator 4.0, and Microsoft Internet Explorer 4.0 and 5.0 and is entirely a "client-side" technology.

Features of DHTML

Simplest feature is making the page dynamic.
Can be used to create animations, games, applications, provide new ways of navigating through web sites.
DHTML use low-bandwidth effect which enhance web page functionality.
Dynamic building of web pages is simple as no plug-in is required.
Facilitates the usage of events, methods and properties and code reuse.

Which Browsers Support Dhtml And How Will Non-supporting Browsers Handle Dhtml?

Version of Netscape navigator and Internet Explorer higher than 4.0 or 4.0 supports DHTML in easy way. But as compared to both browsers Internet Explorer 4.0+ supports the DHTML in the best way.

DHTML includes JavaScript to make the page dynamic and regardless of which scripts is written for and the scripts are designed in such a way that it can be compatible with as many numbers of browsers as possible. The most important thing that must be kept in the mind is that we must test the code before running it over the server or making it live. Also we certainly cannot guarantee that all users will use the browser that will support the scripts.

What Are Technologies We Use In Dhtml? Explain Their Significance In Dhtml Application?

Speaking in true sense there is nothing dynamic in DHTML but enclosing technologies such as CSS, JavaScript, DOM and the static markup language it becomes dynamic.

JavaScript : Whether we call it JavaScript, Jscript, or ECMA Script, it is the most common language used today for client-side scripting. The main reason for this JavaScript comes with virtually every browser. For example, an onload event could execute a JavaScript function to query the browser’s cookies collection to determine whether the user is a first-time visitor to the page.

CSS : It stands for Cascading Style Sheet. This is used for the presentation part of the web page. In simple words it holds the designing of the page. The look & feel of the page completely depends on CSS. In DHTML CSS rules can be modified at both the document and the element level using JavaScript with event handlers, they can add a significant amount of dynamism with very little code.

DOM : It stands for Dynamic Object Model and it is the weakest link in DHTML as many of the browser does not support the DOM functionality. It defines the object and its properties. It is a standard way of accessing and manipulating the static content. The Document Object Model is a platform and language-neutral interface that allows program and scripts to dynamically access the content and update it.

Depict With Explanation A Usable Real-world Example Of Dhtml Scripting.?

<html>
<head>
<title> DHTML In Real World <title>
<script type="text/javascript">
          function Opens_Child_Window()
          {
               var getUsername=document.getElementById("userName").value;
               var openChild= window.open("","","height=300,width= 600");
               openchild.document.Write(“ Welcome!!!!”+getUsername)
          }
</script>
</head>
<body>
<table border="1" boredercolor="blue" cellspacing="3">
     <tr>
          <td> <b> User Name: </b> </td>
          <td> <input type="text" id="userName" property="userName"/> </td>
     </tr>
     <tr>
          <td colspan="2" align="center">
               <input type="button" value="Click Me!!!" onclick="Opens_Child_Window()"/>
          </td>
     </tr>
</table>
</body>
</html>

In the above designed DHTML we have a textbox to take the user name and on clicking the button a function of name Opens_Child_Window( ) is called which greets user in new window with his name. The new window is opened with the help of window.open property of Window.

Explain How To Handle Events With Dhtml.?

A DHTML application supports numerous events, many of them quite analogous to those of a standard VB application. Events are the beating heart of any JavaScript application. For handling event in DHTML we attach event handler to HTML elements. The event handler waits until a certain event, for instance a click on a link, takes place.

When it happens it handles the event by executing some JavaScript code that has been defined by us. After it has executed the code the event handlers comes to its initial state and wait for the user to fire any event. Hence to handle events in DHTML we need to register an event handler.

Difference Between Dhtml And Html?

1. The first and foremost difference is HTML is markup language but DHTML is not a language.
2. DHTML stands with combination of HTML, CSS, JavaScript and DOM but HTML alone is an enough although static.
3. HTML cannot have nay server side code but DHTML may contain server side code also.
4. In HTML there is no need for database connectivity but DHTML may require to connect to database as it interacts with user.

What Is The Necessity Of Empty Tag?

The first foremost good thing to notice about empty tag is that they need not to be closed. There necessities play an important role in development of web pages as we can create links define input tags which include button, text, hidden fields. Provide links to images and line breaks. For eg: the <hr> tag is an empty tag which is used to draw a horizontal line on the page.

Explain About Struts Dispatch Action In Dhtml.?

DispatchAction is an action that comes with Struts 1.1 or later, that let us combine Struts actions into single class, each with their own method. The org.apache.struts.action.DispatchAction class allows multiple operations to map to the different functions in the same Action class.

For Example

<html:hidden property="dispatch" value="error"/>

<SCRIPT>function set(target) {document. forms[0].dispatch. value=target;}</SCRIPT>

How To Upload Struts File In Dhtml?

The interface org.apache.struts.upload.FormFile is used for the struts file upload application. This interface represents a file that has been uploaded by a client. It is the only interface or class in upload package which is typically referenced directly by a Struts application.

This is not specific to Struts in case of DHTML but the two things that are needed in DHTML page is: first, the form needs to specify an enctype of multipart/form-data and second an <input> form control of type file.

Following are the steps to load file in DHTML

1. Creating a bean
2. Writing the ActionClass
3. Mapping the bean in struts-config.xml
4. Defining actionmapping
5. Developing the DHTML page

Steps Used To Create A Tiles Application In Dhtml?

1. Create a template that designs a layout for your application.
2. Create the composing pages.
3. Create a definition which means that suppose that you configured Tiles, in web.xml, to startup using the TilesServlet, we need to specify which files will contain the Tiles definitions to load.
4. Render the definition.

How Is Fontsize And Font Size Differ In Dhtml?

1. Font size is an attribute that we used in font tag, where as font-size is a style property.
2. Font size is to be defined for every tag that we need to use in but font-size can be applied as a general class of action.

What Are The Attributes That Make Up A Dhtml? Explain Those Attributes.?

The attributes that make up DHTML are HTML, JavaScript, CSS and DOM. These are explained below as

1. JavaScript : Whether we call it JavaScript, Jscript, or ECMAScript, it is the most common language used today for client-side scripting. The main reason for this JavaScript comes with virtually every browser. In DHTML JavaScript JavaScript comes with virtually every browser. For example, an onload event could execute a JavaScript function to query the browser’s cookies collection to determine whether the user is a first-time visitor to the page.

2. CSS : It stands for Cascading Style Sheet. This is used for the presentation part of the web page. In simple words it holds the designing of the page. The look & feel of the page completely depends on CSS. In DHTML CSS rules can be modified at both the document and the element level using JavaScript with event handlers, they can add a significant amount of dynamism with very little code.

3. DOM : It stands for Dynamic Object Model and it is the weakest link in DHTML as many of the browser does not support the DOM functionality. It defines the object and its properties. It is a standard way of accessing and manipulating the static content. The Document Object Model is a platform and language-neutral interface that allows program and scripts to dynamically access the content and update it.

4. HTML : It stands for Hyper Text Markup Language. As the names suggest it is not a programming language, it is a markup language which consists of a set of markup tags.

Explain Three Important Components Of Dynamic Html Authoring - Positioning, Style Modifications And Event Handling?

1. Positioning : Is some what where we need the object to be placed in the graphical view i:e on screen. If we talk in DHTML sense then we have two types of positioning: Relative and Absolute.

2. Relative Positioning : Relative positioning is the same as the current HTML3 layout and is best reserved for situations where you want to be sure that the content will revert to this default inside a document that also uses absolute positioning.

3. Absolute Positioning : In DHTML absolute positioning means that the object will remain at the same position regardless of the condition of other elements and the size of the browser. In simple languages if an object/image is absolutely positioned (STYLE="position: absolute;"), with an offset of 150 pixels to the right and 250 pixels down from the left-hand corner of the browser screen then it will avail this position what ever the circumstances may be.

4. Style Modifications : Style modification indicates the changes in the presentation or the view part that are being made in web page. This part comes under Cascading Style Sheet where the user style his web page by using the attributes and the tags that are pre-defined in CSS.

5. Event Handling : As explained earlier Events is the beating heart of any JavaScript application. For handling event in DHTML we attach event handler to HTML elements. The event handler waits until a certain event, for instance a click on a link, takes place. When it happens it handles the event by executing some JavaScript code that has been defined by us. After it has executed the code the event handler comes to its initial state and waits for the user to fire any event. Hence to handle events in DHTML we need to register an event handler.

https://mytecbooks.blogspot.com/2019/06/dynamic-html-most-frequently-asking.html
Subscribe to get more Posts :

1 comments:

Write comments
July 18, 2019 at 8:15 PM delete

Nice Blog! Thanks to Admin for Sharing HTML5 Interview Questions. I bookmarked this link. Keep sharing such good technical Articles. Addition to your Story here I am Contributing a more Similar Story Advanced HTML5 interview Questions and Answers.

Reply
avatar