DHTML and Javascript

Here are the top interview questions for DHTML and JavaScript Developer, the questions are submitted by professionals to help you to ace the job interview.

Q.1 What happens if three p tags are in a row?
If three p tags are in a row then the browser uses only the first tag and ignores the others.
Q.2 You created an unordered list with four list items. All the content following the fourth list item that should be normal text is indented under the list. What is the most likely cause of this problem?
The most likely cause of this problem is a missing closing tag.
Q.3 What does the following CSS selection indicates -- "p.top a { color: red; }"
Links to appear red in paragraphs having class named top
Q.4 What do you understand by Javascript?
JavaScript has been defined as a general-purpose programming language designed to allow programmers to control the behavior of software objects. Javascript language has been used widely in Web browsers whose software objects tend to represent a variety of HTML elements in a document and the document itself. Javascript language is used with other kinds of objects in other environments. Therefore it is important to distinguish JavaScript, the language, from the objects it can communicate with in any particular environment. Javascript when used for Web documentation, the scripts go directly inside the HTML documents and are downloaded to the browser with the rest of the HTML tags and content.
Q.5 Which technologies are used in DHTML and describe their significance in DHTML application?
There is nothing dynamic in DHTML yet enclosing technologies like CSS, JavaScript, DOM and the static markup language it becomes dynamic.
1. JavaScript : JavaScript referred as Jscript, or ECMA Script, one of the most common language used today for client-side scripting. The primary reason for this JavaScript comes with virtually every browser. For instance 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 : CSS stands for Cascading Style Sheet which is used for the presentation part of the web page. It holds the designing of the page such that the primary look and feel of the page depends on CSS. In DHTML CSS rules can be modified at both the document and the element level using JavaScript with event handlers, such that they can add a significant amount of dynamism with very little code.
3. DOM : DOM stands for Dynamic Object Model is the weakest link in DHTML as many of the browser does not support the DOM functionality. DOM defines the object and its properties as a standard way of accessing and manipulating the static content. The DOM Model is a platform and language-neutral interface that permits program and scripts to dynamically access the content and update it.
Q.6 According to you, which browsers support DHTML and how does non-supporting browsers handle DHTML?
DTML is supported by Version of Netscape Navigator and Internet Explorer higher than 4.0 in the most convenient manner. As compared to both browsers Internet Explorer 4.0+ supports the DHTML in the best way. DHTML includes JavaScript to build the page dynamic and irrespective 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. One of the most crucial thing which must be kept in the mind is that we must test the code before running it over the server or making it live. Indeed we cannot guarantee that all users will use the browser that will support the scripts.
Q.7 Differentiate between DHTMLand HTML?
Some of the points of difference between DHTMLand HTML -
1. Difference between DHTML and HTML is that HTML is a 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.
Q.8 What are the important components of dynamic HTML authoring?
Some of the important components of dynamic HTML authoring are - 2. Relative Positioning - It is relative positioning which is somewhat same as current HTML3 layout and is considered as 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 - DHTML is an absolute positioning which refers to that the object will remain at the same position irrespective of the condition of other elements and the size of the browser.
4. Style Modifications - This 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 - It is explained earlier events is the beating heart of any JavaScript application. In order to handling event in DHTML we attach event handler to HTML elements. Such that the event handler waits until a certain event, for instance a click on a link, takes place. Such that when event handling happens it handles the event by executing some JavaScript code that has been defined by us. Also after it has executed the code the event handler comes to its initial state and waits for the user to fire any event.
Q.9 According to you what is the necessity of 'Empty Tag'?
The first thing to notice with reference empty tag is that they need not to be closed. The necessity of empty tags play a crucial role in development of web pages as we can create links define input tags that include button, text, hidden fields which provide links to images and line breaks. For instance the
tag is an empty tag used to draw a horizontal line on the page.
Q.10 What do you understand by Struts Dispatch Action in DHTML?
Dispatch Action is a defined as an action which comes with Struts 1.1 or later, that helps to combine Struts actions into single class, each with their own method. The org.apache.struts.action.DispatchAction class permits multiple operations to map to the different functions in the same Action class.
Q.11 What are the steps used to create a tiles application in DHTML?
Some of the steps used to create a tiles application in DHTML are -
1. To create a template that designs a layout for your application.
2. To create the composing pages.
3. To 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. To render the definition.
Q.12 How do you define Logic Match Tag?
Logic match tag can be defined as an evaluator that assesses the nested body content of tag to check whether the specified value is an appropriate substring of the requested variable. It is required to match the variable specified by one of the selector attributes against the specified constant value. Therefore if the value is a substring the nested body content of this tag is thereby evaluated.
Q.13 Differentiate between DHTML and HTML?
Some of the difference between DHTML (Dynamic HTML) and HTML (Hyper Text Markup Language) are -
1. Using DHTML we can use JavaScript and style sheets in our HTML page.
2. Using DHTML we can insert small animations and dynamic menus into our HTML page.
3. If use want that your web page display your DHTML effects (such that object or word can highlighted, larger, different color) such that then you have to save your web page with .dhtml extension except .html or .htm
Q.14 What is the primary difference between FontSize and Font Size, in DHTML?
The primary point of difference between is that “FontSize” is a property, such that “Font Size” is a style in DHTML.
Q.15 What are the attributes that make up a DHTML?
DHTML abbreviated as Dynamic HTML which is used to increase the interactive ability and the visual effect of the web pages that is loaded in the browser. The primary technologies used in DHTML are namely - HTML, JavaScript and CSS also referred as Cascading Style Sheet. The DOM also referred as Document Object Model
Q.16 Specify the advantages of using External JavaScript?
Some of the advantages of using External JavaScript in our code ae -
1. Separation of Code is done.
2. Code Maintainability is Easy.
3. Performance is better.
Q.17 Specify the primary advantages of JavaScript?
Some of the advantages of JavaScript Scripting language are -
1. Lightweight: JavaScript is easy to implement and has small memory footprints.
2. Interpreted: It is an interpreted language such that instructions are executed directly.
3. Object-oriented: JavaScript is an object-oriented language.
4. First class functions: In JavaScript, function can be used as a value.
5. Scripting Language: JavaScript is a language in which instructions are written for a run-time environment.
Q.18 What browser have you used for debugging?
We can enable debugging in the browser by pressing ‘F12’ key in the keyboard. Thereafter chose the ‘Console’ tab to view the result. Such that in Console, we can set breakpoints and view the value in variables. Also the modern browsers have a built-in debugger with them (For instance Chrome, Firefox, Opera, and Safari) which can be turned ON and OFF.
Q.19 How do you describe JavaScript Hoisting?
When we use ‘JavaScript Hoisting’ method, an interpreter runs the code, such that all the variables are hoisted to the top of the original /current scope. When we have a variable declared anywhere inside the JavaScript code then it is brought to the top. JavaScript Hoisting method is only applicable for the declaration of a variable and not applicable for initialization of a variable. Also functions are also hoisted to the top, whereas function explanations are not hoisted to the top.
Q.20 How do you define JavaScript ‘Strict Mode’?
‘Strict mode’ is a restricted variant of JavaScript. In general, JavaScript is ‘not very strict’ in throwing errors. But in ‘Strict mode’ which throws all types of errors, even the silent errors. Thus, the process of debugging becomes easier and the chances for making mistake for the developer is reduced.
Q.21 How do you define self invoking functions?
Self invoking functions are also referred as ‘Immediately Invoked Function Expressions’ or ‘Self Executing Anonymous Functions’. Self invoking functions are invoked automatically in the code, hence they are named as ‘Self Invoking Functions’. In general, we define a function and invoke it, yet if we want to execute a function automatically where it is explained, and if we are not going to call it again, we can use anonymous functions. Also these kind of function have no name.
Get Govt. Certified Take Test